10.07.2012, 13:05
try this too :
Код:
#include <a_samp> #define COLOR_BOT 0xFF00FFFF // Bot colors (its Pink Now) new BotName[24] = "BotName"; // Bot's Name public OnFilterScriptInit() { print("==========================="); print("ChatBot "); print("==========================="); return 1; } public OnPlayerConnect(playerid) { SendBotMessage("Welcome, This Server is Using me !"); return 1; } forward SendBotMessage(msg[]); public SendBotMessage(msg[]) { for(new playerid=0;playerid<MAX_PLAYERS;playerid++) { if(IsPlayerConnected(playerid)==1 && GetPlayerColor(playerid) != 0) { new pName[18]; format(pName,sizeof(pName),"%s",PlayerName(playerid)); new ColorSave = GetPlayerColor(playerid); SetPlayerColor(playerid,COLOR_BOT); SetPlayerName(playerid,BotName); SendPlayerMessageToAll(playerid,msg); SetPlayerColor(playerid,ColorSave); SetPlayerName(playerid,pName); return 1; } } return 1; } stock PlayerName(playerid) { new pName2[MAX_PLAYER_NAME]; GetPlayerName(playerid, pName2, MAX_PLAYER_NAME); return pName2; } public OnPlayerText(playerid, text[]) { if(!strcmp(text, "hi", true) || !strcmp(text, "hello", true) || !strcmp(text, "hey", true) || !strcmp(text, "yo", true)) { SendPlayerMessageToAll(playerid, text); SendBotMessage("Hey Honey!"); return 0; } /* if(!strcmp(text, "MESSAGE", true) || !strcmp(text, "MESSAGE", true) || !strcmp(text, "MESSAGE", true) || !strcmp(text, "MESSAGE", true)) { SendPlayerMessageToAll(playerid, text); SendBotMessage("MESSAGE!!!"); return 0; }*/ // Use this to add more! return 1; }