#define BOT_NAME "YourBotName"
public DCC_OnChannelMessage(DCC_Channel:channel, DCC_User:author, const message[])
{
new channel_name[100 + 1], user_name[32 + 1], user[24];
if(!DCC_GetChannelName(channel, channel_name)) return 0; // invalid channel
if(!DCC_GetUserName(author, user_name)) return 0; // invalid user
DCC_GetUserName(DCC_User:author, user, 24);
if(!strcmp(user, BOT_NAME)) return 0; // Don't show bot messages in chat
}
public DCC_OnChannelMessage(DCC_Channel:channel, DCC_User:author, const message[]) { new channel_name[100 + 1]; if(!DCC_GetChannelName(channel, channel_name)) return 0; new user_name[32 + 1]; if (!DCC_GetUserName(author, user_name)) return 0; if(channel != BotChannel) return 0; new str[145]; format(str, sizeof str, "{667aca}[Discord]%s:{ffffff} %s", user_name, message); for(new i = 0; i < MAX_PLAYERS; i++) { if (DiscordStats[i]==0) continue; SendClientMessage(i, -1, str); } return 1; }
new DCC_Channel:BotChannel; new DiscordStats[MAX_PLAYERS]; new Spawned[MAX_PLAYERS];
#define BOT_NAME "YourBotName"
public DCC_OnChannelMessage(DCC_Channel:channel, DCC_User:author, const message[])
{
new channel_name[100 + 1];
if(!DCC_GetChannelName(channel, channel_name)) return 0; // invalid channel
new user_name[32 + 1];
if (!DCC_GetUserName(author, user_name)) return 0; // invalid user
if(!strcmp(user_name, BOT_NAME)) return 0; // Don't show bot messages in chat
new str[128];
format(str, sizeof str, "{667ACA}[Discord]%s:{FFFFFF} %s", user_name, message);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(DiscordStats[i] != 0);
SendClientMessage(i, -1, str);
}
return 1;
}
D:\SAMP BP 2\scriptfiles\0Admin\DConnect.pwn(90) : error 036: empty statement D:\SAMP BP 2\scriptfiles\0Admin\DConnect.pwn(91) : warning 217: loose indentation Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
if(DiscordStats[i] != 0); SendClientMessage(i, -1, str);
D:\SAMP BP 2\scriptfiles\0Admin\DConnect.pwn(90) : error 036: empty statement
Getting the Following Error:
Код:
D:\SAMP BP 2\scriptfiles\0Admin\DConnect.pwn(90) : error 036: empty statement D:\SAMP BP 2\scriptfiles\0Admin\DConnect.pwn(91) : warning 217: loose indentation Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error. Код:
if(DiscordStats[i] != 0); SendClientMessage(i, -1, str); |