17.02.2011, 16:41
pawn Код:
public OnPlayerText(playerid, text[])
{
new BotStr1[200];
format(BotStr1, sizeof(BotStr1), "%s?", BotName);
new BotStr2[200];
format(BotStr2, sizeof(BotStr2), "%s:", BotName);
new BotStr3[200];
format(BotStr3, sizeof(BotStr3), "%s: %s", BotName, AgeQuestion);
if(strcmp(BotName, text, true) == 0)
{
if(BotOn == 1)
{
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
format(String[playerid], 200, "%s, %s", Name, Sayings[random(sizeof(Sayings))]);
//SetTimerEx("Send",170,0,"i", playerid, String[playerid]);
SetTimerEx("Send",170,0,"i", playerid);
return 1;
}
}
else if(strcmp(BotStr1, text, true) == 0)
{
if(BotOn == 1)
{
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
format(String[playerid], 200, "%s, %s", Name, Sayings[random(sizeof(Sayings))]);
//SetTimerEx("Send",170,0,"i", playerid, String[playerid]);
SetTimerEx("Send",170,0,"i", playerid);
return 1;
}
}
else if(strcmp(BotStr3, text, true) == 0)
{
if(BotOn == 1)
{
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
format(String[playerid], 200, "%s, eu sou tenho %d a mais que vocк.", Name, BotAge);
//SetTimerEx("Send",170,0,"i", playerid, String[playerid]);
SetTimerEx("Send",170,0,"i", playerid);
return 1;
}
}
else if(strfind(text, BotStr2, true) != -1 && strfind(text, "?", true, 0) != -1)
{
if(BotOn == 1)
{
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
format(String[playerid], 200, "%s, %s", Name, Answers[random(sizeof(Sayings))]);
//SetTimerEx("Send",170,0,"i", playerid, String[playerid]);
SetTimerEx("Send",170,0,"i", playerid);
return 1;
}
}
else if(strcmp(BotStr2, text, true) == 0)
{
if(BotOn == 1)
{
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
format(String[playerid], 200, "Errrm %s, %s", Name, EmptyQuestionResponces[random(sizeof(EmptyQuestionResponces))]);
//SetTimerEx("Send",170,0,"i", playerid, String[playerid]);
SetTimerEx("Send",170,0,"i", playerid);
return 1;
}
}
else if(strfind(text, BotName, true) != -1)
{
if(BotOn == 1)
{
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
format(String[playerid], 200, "%s, %s", Name, TalkingAboutMe[random(sizeof(TalkingAboutMe))] );
//SetTimerEx("Send",170,0,"i", playerid, String[playerid]);
SetTimerEx("Send",170,0,"i", playerid);
return 1;
}
}
return 1;
}