SA-MP Forums Archive
hey i need help with this chatbot - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: hey i need help with this chatbot (/showthread.php?tid=358807)



delete - raptors - 11.07.2012

delete


Re: hey i need help with this chatbot - Georgi166 - 11.07.2012

I see a code...What help you want LOL


Re: hey i need help with this chatbot - Hoss - 11.07.2012

pawn Код:
#include <a_samp>

#define COLOR_BOT 0x008000FF // Bot colors (its green Now)

new BotName[24] = "Tony"; // Bot's Name

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 OnFilterScriptInit()
{


print("===========================");
print("talkbot By ant1");
print("===========================");
return 1;
}

public OnPlayerConnect(playerid)
{
SendBotMessage("Welcome, This Server is Using me !");
SendBotMessage("please, If you see a hacker report them !");
SendBotMessage("need any help always ask an admin !");

return 1;
}


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;
}
return 1;
}



delete - raptors - 11.07.2012

delete