how to make /me with dmcd - 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: how to make /me with dmcd (
/showthread.php?tid=185782)
[UNSOLVED]how to make /me with dmcd -
[WSF]ThA_Devil - 26.10.2010
please help! how to make /me with dcmd!
im not so pro scripter..... so plz help me....
Re: how to make /me with dmcd -
Calgon - 26.10.2010
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.
Re: how to make /me with dmcd -
[WSF]ThA_Devil - 26.10.2010
ok thx! i ll try to learn zcmd!
Re: how to make /me with dmcd -
[WSF]ThA_Devil - 26.10.2010
wtf?
pawn Код:
warning 203: symbol is never used: "me"
Re: how to make /me with dmcd -
Calgon - 26.10.2010
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.
Re: how to make /me with dmcd -
[WSF]ThA_Devil - 26.10.2010
oh
no xD xD
Re: how to make /me with dmcd -
[WSF]ThA_Devil - 26.10.2010
when i do /me cmd it just shows my username and thats all!
Re: how to make /me with dmcd -
Calgon - 26.10.2010
Sorry, replace:
pawn Код:
format(_msgSz, sizeof(_msgSz), "* %s %s", _playerNameSz, _msgSz);
with
pawn Код:
format(_msgSz, sizeof(_msgSz), "* %s %s", _playerNameSz, params);
Re: how to make /me with dmcd -
[WSF]ThA_Devil - 26.10.2010
oh... params xD