new string[256];
public OnRconCommand(cmd[])
{
format(string, sizeof(string), "%s", cmd);
IrcSay(string);
return 1;
}
public ircOnUserSay(conn, channel[], user[], message[])
{
if(message[0] != '!') return 1;
irccmd(serversay,9,conn,channel,user,message);
return 1;
}
irccmd_serversay(conn, channel[], user[], params[])
{
if(!ircIsOp(conn,channel,user)) return IrcSay("Only irc ops can use this command");
new string[128];
if(!strlen(params)) return IrcSay("USAGE: !serversay <message>");
format(string,sizeof(string), "***s.a.dBOT: %s", params);
SendClientMessageToAll(0xFF0000AA, string);
IrcSay(string);
return 1;
}
#define irccmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (irccmd_%1(conn,channel,user,"")))||(((%3)[(%2) + 1] == 32) && (irccmd_%1(conn,channel,user,(%3)[(%2) + 2]))))) return 1
dcmd_bot(playerid, cmdtext[]) { new message[256], index; message = strrest(cmdtext, index); if (!strlen(message)) return SendClientMessage(playerid, red, "Usage: /bot <message>"); format(message, sizeof(message), "* Bot: %s", message); SendClientMessageToAll(blue, message); return 1; } |
bot.pwn(59) : error 033: array must be indexed (variable "message")
#include <a_samp> #define FILTERSCRIPT #define strrest #define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1 #if defined FILTERSCRIPT public OnFilterScriptInit() { print("\n--------------------------------------"); print(" IRC bot Chat!"); print("--------------------------------------\n"); return 1; } public OnFilterScriptExit() { return 1; } #else main() { print("\n----------------------------------"); print(" Blank Gamemode by your name here"); print("----------------------------------\n"); } #endif public OnGameModeInit() { SendClientMessageToAll(0xFF000AA, "Please Repect the TokyoDrift Bot!"); SendClientMessageToAll(0xFF000AA, "Not doing so will get you banned!"); return 1; } public OnGameModeExit() { return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { dcmd(bot, 3, cmdtext); return 0; } dcmd_bot(playerid, cmdtext[]) { new message[500], index; message = strrest(cmdtext, index); if (!strlen(message)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /bot <message>"); format(message, sizeof(message), "**TokyoDrift: %s", message); SendClientMessageToAll(0x0000FFFF, message); return 1; }
public OnPlayerCommandText(playerid, cmdtext[]) { if(!strcmp(cmdtext, "/bot", true, 4)) // 4 is the length of /bot { if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /bot [message]"); new str[128]; format(str, sizeof(str), "*Tokyo-Drift_BOT %s", str, cmdtext[4]); SendClientMessageToAll(0xFFFF00AA, str); return 1; } return 0; }
SERVER: You are now logged in as Admin ->->->->*Tokyo-Drift_BOT<-<-<-<-<- DeJordzta: hey all, how r u guyz?
\samp02Xserver.win32\filterscripts\irc.pwn(27) : warning 235: public function lacks forward declaration (symbol "ircOnUserSay") \samp02Xserver.win32\filterscripts\irc.pwn(31) : warning 217: loose indentation \samp02Xserver.win32\filterscripts\irc.pwn(37) : error 017: undefined symbol "ircIsOp" \samp02Xserver.win32\filterscripts\irc.pwn(37) : error 017: undefined symbol "IrcSay" \samp02Xserver.win32\filterscripts\irc.pwn(41) : error 017: undefined symbol "IrcSay" \samp02Xserver.win32\filterscripts\irc.pwn(35) : warning 203: symbol is never used: "conn" \samp02Xserver.win32\filterscripts\irc.pwn(35 -- 48) : error 010: invalid function or declaration Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
#include <a_samp> //Talk As Bot IRC Op Command Filterscript by Dice7 #define FILTERSCRIPT #define irccmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (irccmd_%1(conn,channel,user,"")))||(((%3)[(%2) + 1] == 32) && (irccmd_%1(conn,channel,user,(%3)[(%2) + 2]))))) return 1 public OnFilterScriptInit() { print("\n--------------------------------------"); print(" TALK AS BOT, By DEJORDZTA "); print("--------------------------------------\n"); return 1; } public OnFilterScriptExit() { return 1; } public ircOnUserSay(conn, channel[], user[], message[]) { if(message[0] != '!') return 1; irccmd(serversay,9,conn,channel,user,message); return 1; } irccmd_serversay(conn, channel[], user[], params[]) { if(!ircIsOp(conn,channel,user)) return IrcSay("Only irc ops can use this command"); new string[128]; if(!strlen(params)) return IrcSay("USAGE: !serversay <message>"); format(string,sizeof(string), "***TD-BOT: %s", params); SendClientMessageToAll(0xFF0000AA, string); return 1; } return 0;