Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #if defined Credits
- ================================================================================
- --------------------------- SIMPLE DISCORD CONNECTOR ---------------------------
- SSSSSSS TTTTTTT EEEEEEE VV VV AAAAA NNN NN OOOOOOO VV VV III CCCCCCC
- SSSSSSS TTTTTTT EEEEEEE VV VV AAAAAAA NNNN NN OO OO VV VV III CC CC
- SS TTT EE VV VV AA AA NNNN NN OO OO VV VV III CC
- SSSSSSS TTT EEEEEEE VV VV AAAAAAA NNNN NN OO OO VV VV III CC
- SSSSSSS TTT EEEEEEE VV VV AAAAAAA NN NNNN OO OO VV VV III CC
- SS TTT EE VV VV AA AA NN NNN OO OO VV VV III CC
- SSSSSSS TTT EEEEEEE VV VV AA AA NN NN OOOOOOO VV VV III CC CC
- SSSSSSS TTT EEEEEEE VVV AA AA NN NN OOOOOOO VVV III CCCCCCC
- ==== by: Stevanovic v0.0.1x ====
- ========================================================================
- #endif
- //*****************************[ INCLUDES ]***********************************//
- #include <a_samp>
- #include <discord-connector>
- //*******************************[ NEW ]**************************************//
- new DCC_Channel:g_Discord_Chat;
- new DCC_Channel:g_Discord_Chat2;
- //****************************************************************************//
- public OnFilterScriptInit()
- {
- print(" by Stevanovic V0.0.1x ");
- g_Discord_Chat = DCC_FindChannelById("000000000000000"); // ID Discord kanala
- g_Discord_Chat2 = DCC_FindChannelById("000000000000000"); // ID Discord kanala
- return 1;
- }
- //****************************************************************************//
- forward DCC_OnMessageCreate(DCC_Message:message);//Prikazuje poruke InGame ukoliko pise neko u text kanalu gde je bot povezan!
- public DCC_OnMessageCreate(DCC_Message:message)
- {
- new realMsg[100];
- DCC_GetMessageContent(message, realMsg, 100);
- new bool:IsBot;
- new DCC_Channel:channel;
- DCC_GetMessageChannel(message, channel);
- new DCC_User:author;
- DCC_GetMessageAuthor(message, author);
- DCC_IsUserBot(author, IsBot);
- if(channel == g_Discord_Chat && !IsBot) //Sakriva poruke koje bot salje!
- {
- new user_name[32 + 1], str[152];
- DCC_GetUserName(author, user_name, 32);
- format(str,sizeof(str), "{3bd717}Clan: %s {ffffff}%s", realMsg);
- SendClientMessageToAll(-1, str);
- }
- return 1;
- }
- //****************************************************************************//
- public OnPlayerClickPlayer(playerid)//Kad otvori Tab i klikne na igraca!
- {
- new name[MAX_PLAYER_NAME + 1];
- GetPlayerName(playerid, name, sizeof name);
- if (_:g_Discord_Chat == 0)
- g_Discord_Chat = DCC_FindChannelById("000000000000000"); // ID Discord kanala
- new string[128];
- format(string, sizeof string, " ```%s gleda statistiku od nekog igraca [TAB]```", name);
- DCC_SendChannelMessage(g_Discord_Chat, string);
- return 1;
- }
- //****************************************************************************//
- public OnPlayerSpawn(playerid)//Kada neko udje na server i bude spawnan!
- {
- new name[MAX_PLAYER_NAME + 1];
- GetPlayerName(playerid, name, sizeof name);
- if (_:g_Discord_Chat == 0)
- g_Discord_Chat = DCC_FindChannelById("000000000000000"); // ID Discord kanala
- new string[128];
- format(string, sizeof string, " ```%s je upesno spawnovan [SPAWN]```", name);
- DCC_SendChannelMessage(g_Discord_Chat, string);
- return 1;
- }
- //****************************************************************************//
- public OnPlayerCommandText(playerid, cmdtext[])//Kada neko na serveru ukuca ovaj CMD bot salje poruku u odredjen kanal!
- {
- if(!strcmp(cmdtext, "/ipservera", true))
- {
- new string[128],
- string2[128];
- if (_:g_Discord_Chat2 == 0)
- g_Discord_Chat2 = DCC_FindChannelById("000000000000000"); // ID Discord kanala
- format(string, sizeof string, " ```VAS TEXT```");
- format(string2, sizeof(string2), " ```VAS TEXT```");
- DCC_SendChannelMessage(g_Discord_Chat2, string, string2);
- return 1;
- }
- return 0;
- }
- //****************************************************************************//
- public OnPlayerDeath(playerid)//Kada neko umre na serveru!
- {
- new name[MAX_PLAYER_NAME + 1];
- GetPlayerName(playerid, name, sizeof name);
- if (_:g_Discord_Chat == 0)
- g_Discord_Chat = DCC_FindChannelById("000000000000000"); // ID Discord kanala
- new string[128];
- format(string, sizeof string, " ```%s je upravo ubijen [DEATH]```", name);
- DCC_SendChannelMessage(g_Discord_Chat, string);
- return 1;
- }
- //****************************************************************************//
- public OnPlayerConnect(playerid)//Kada se igrac disconnectuje sa servera!
- {
- new name[MAX_PLAYER_NAME + 1];
- GetPlayerName(playerid, name, sizeof name);
- if (_:g_Discord_Chat == 0)
- g_Discord_Chat = DCC_FindChannelById("000000000000000"); // ID Discord kanala
- new string[128];
- format(string, sizeof string, " ```%s je uspesno usao na server [CONNECT]```", name);
- DCC_SendChannelMessage(g_Discord_Chat, string);
- return 1;
- }
- //****************************************************************************//
- public OnPlayerDisconnect(playerid, reason)//Kada se igrac disconnectuje sa servera!
- {
- new name[MAX_PLAYER_NAME + 1];
- GetPlayerName(playerid, name, sizeof name);
- if (_:g_Discord_Chat == 0)
- g_Discord_Chat = DCC_FindChannelById("000000000000000"); // ID Discord kanala
- new string[128];
- format(string, sizeof string, " ```%s je uspesno izasao sa servera [DISCONNECT]```", name);
- DCC_SendChannelMessage(g_Discord_Chat, string);
- return 1;
- }
- //****************************************************************************//
Add Comment
Please, Sign In to add comment