10.07.2012, 12:04
Here we are bro! Compiled without error, didn't tested!
If you still have error send your script and i will add it to your script!
pawn Код:
#define COLOR_BOT 0xFF00FFFF
new BotName[24] = "Tony";
public OnPlayerConnect(playerid)
{
SendBotMessage("i am programed to talk to you !");
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 pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
return pName;
}
public OnPlayerText(playerid, text[])
{
if(!strcmp(text, "hi", true) || !strcmp(text, "hello", true) || !strcmp(text, "hey", true) || !strcmp(text, "sup", true)) // player words/sentences !
{
SendPlayerMessageToAll(playerid, text);
SendBotMessage(" How Are You Today!"); // respond message
SendBotMessage("Whats your name!"); // respond message
return 0;
}
return 1;
}