A Vice City Multiplayer Server Side Library for integrating Discordjs
- npm install using a [cmd/shell] in the root directory
- run ADiscord with
node index.js
- place ADiscord Folder inside Script
- dofile the files
- init ADiscord at Server ScriptLoad
dofile( "scripts/ADiscord/ADiscord.nut" );
ADiscord.Init ()
- When using ADiscord.user.send or ADiscord.user.messageEmbed outside of a ADiscord event you must be sure ADiscord is running
- So, you must provide ADiscord.ready, to make sure is safety to use any function, if not provided can cause a crash intentionally
onPlayerJoin (player) {
// secure to use
if (ADiscord.ready) ADiscord.user.send ("testing", channelId);
// can cause crashes
ADiscord.user.send ("testing", channelId);
}
- not in all cases, but I encounter few problems when calling vcmp variables.
- I suggest using :: on every variable used inside, Ex.
addEventHandler.on ("message", function (message) {
::Message ("good :D");
Message ("this can cause trouble");
// always use :: to make sure the good working of ur server, only when calling vcmp properties/variables
::GetPlayers ();
});
Remember you can print all client members
- ADiscord.user
- ADiscord.application
- ADiscord.guilds
- ADiscord.channels
- ADiscord.emojis
- ADiscord.roles
once ADiscord is ready you can print all members one by one
print (toJSON (ADiscord.user));
also when using the message listener or command listener you can just do
print (toJSON (message));
if that wasn't enought refer to the Wiki