samp.directory
← Skrypty i biblioteki

RockoSx/dcmd

DCMD is a command handler for discord-connector that gives you more control in your commands.

Biblioteka★ 1zaktualizowano lut 2025MITPawnsampctl
Otwórz na GitHubie

Zainstaluj za pomocą sampctl

sampctl package install RockoSx/dcmd

Uruchom to w folderze swojego projektu. sampctl pobiera pakiet i to, od czego zależy.

Wypróbuj w kompilatorze Pawn →

Dodaje jej pliki include, razem z bibliotekami, od których zależy, do kompilatora Pawn w twojej przeglądarce, gotowe do dołączenia w skrypcie.

Zależy od 1 pakietu

README.md

dcmd

DCMD is a command handler for discord-connector, similar to ZCMD this handler gives you more control in your commands.

Special thanks to:
maddinat0r - Author of discord-connector https://github.com/maddinat0r/samp-discord-connector
Y_Less - Author of y_va https://github.com/pawn-lang/YSI-Includes
Zeex - For the inspiration with zcmd.

Installation

  • Prework
    Before install DCMD you need to install samp-discord-connector. https://github.com/maddinat0r/samp-discord-connector Please, make sure to include your bot token line in server.cfg.
    Optional: using the include y_va.inc from Y_less can enable the use of format in functions like SendDiscord(DCC_Channel:channel, const text[], {Float, _}:...) or SendPrivateMessage(DCC_User:user, const message[], {Float, _}:...) https://github.com/pawn-lang/YSI-Includes

  • Installation of DCMD
    Download the release and copy the file dcmd.inc into your includes folder pawno/includes. After that you need to add this line in the gamemode/filterscript.

#include <dcmd>

Example

For more examples see the file example.pwn

DCMD:prefix(DCC_Message:message, params[]){ //With this command you can change the prefix of the commands. Default is "!"
	if(sscanf(params, "s[6]", params[0])) return SendDiscord(GetChannel(message), "Use: %sprefix (Prefix)", prefix);
	else if(strcmp(params[0], prefix) == 0) return SendDiscord(GetChannel(message), ":fleur_de_lis: The prefix already is `%s`!", prefix);
	else if(SetPrefix(params[0]) == 0) return SendDiscord(GetChannel(message), ":negative_squared_cross_mark: Invalid prefix!");
	SendDiscord(GetChannel(message), ":white_check_mark: The prefix has been changed to \"%s\"", prefix);
	return 1;
}

discordpawnsamp

Ta strona jest zbudowana z tego, co GitHub publikuje o repozytorium. samp.directory nie hostuje kodu. Zgłoś problem z tym wpisem

RockoSx/dcmd: Biblioteka SA-MP | samp.directory