29.01.2013, 12:48
Hello,
The problem is, when you start chatting with the NPC it just keep spamming the Greetings.
Ex:
and so on but with random choices not organized..
any explanation will be appreciated!, thanks
PHP код:
static GreetingsA[9][] = {
"hi","hello","Good Moorning","good afternoon","yo","hey","'ey","hey nigga'","'ey nigga"
};
new randchatA[][] =
{
""#NPC_NAME"Hello, how are things?",
""#NPC_NAME"Hi, how are you?",
""#NPC_NAME"Excuse me do you even know me?!",
""#NPC_NAME"Who're you?"
};
PHP код:
public OnPlayerText(playerid, text[])
{
for(new greetings=0; greetings<sizeof(GreetingsA);) {
#define max 4
new randchatAex = random(sizeof(randchatA));
if(strfind(text, GreetingsA[greetings]) != -1) SendChat(randchatA[randchatAex]);
greetings++;
}
if(strfind(text, "Can I have a room please?") != -1) StartRecordingPlayback(ON_FOOT,"NPC1Hotel");
return 1;
}
Ex:
Код:
Me:Hello Bot: Hello, how are things? Bot: Hi, how are you? Bot: Excuse me do you even know me?! Bot: Who're you? Bot: Who're you?
any explanation will be appreciated!, thanks