Talking bots -
Luis- - 21.05.2011
Well, I have attempted to make a talking bot which will talk to you, I have tried to set it on a timer but it just does not work.
This part works apart from the "SetTimer".
pawn Код:
if(vehicleid == botcar)
{
SendClientMessage(playerid, COLOR_GREY, "Taxi Driver says: Welcome to the Taxi mate, please sit back and enjoy the ride.");
SetTimer("TaxiTalk", 60000, true);
}
pawn Код:
forward TaxiTalk(playerid);
public TaxiTalk(playerid)
{
ProxDetector(3.0, playerid, "Taxi Driver says: Haven't I seen you before?", COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY);
ProxDetector(3.0, playerid, "Taxi Driver says: Lovely weather we are having.", COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY);
ProxDetector(3.0, playerid, "Taxi Driver says: You look happy.", COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY);
return 1;
}
Re: Talking bots -
Biesmen - 21.05.2011
Ofcourse it doesn't work, your function has a parameter.
use SetTimerEx
pawn Код:
SetTimerEx("TaxiTalk", 60000, true, "i", playerid);
Re: Talking bots -
boelie - 21.05.2011
* and you could also change the clientmessage into SendPlayerMessageToPlayer so it actually looks like the bot is talking to you. much cewler
find it here
https://sampwiki.blast.hk/wiki/SendPlayerMessageToPlayer
Re: Talking bots -
Luis- - 21.05.2011
Thanks! I have a question, I have this:
pawn Код:
forward TaxiTalk(playerid);
public TaxiTalk(playerid)
{
ProxDetector(3.0, playerid, "Taxi Driver says: Haven't I seen you before?", COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY);
ProxDetector(3.0, playerid, "Taxi Driver says: Lovely weather we are having.", COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY);
ProxDetector(3.0, playerid, "Taxi Driver says: You look happy.", COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY);
return 1;
}
How could I possible pause it so at the end of one sentence the bot pauses then says the second sentence and at the end of everything the bot does not repeat it.
Re: Talking bots -
Steve M. - 21.05.2011
At the top of your script:
And the timer function:
pawn Код:
forward TaxiTalk(playerid);
public TaxiTalk(playerid)
{
switch(talkSentences)
{
case 0:
{
ProxDetector(3.0, playerid, "Taxi Driver says: Haven't I seen you before?", COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY);
talkSentences++;
}
case 1:
{
ProxDetector(3.0, playerid, "Taxi Driver says: Lovely weather we are having.", COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY);
talkSentences++;
}
case 2:
{
ProxDetector(3.0, playerid, "Taxi Driver says: You look happy.", COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY);
talkSentences = -1;
}
}
return 1;
}
And one more thing, edit your part where the timer is started like this:
pawn Код:
if(vehicleid == botcar)
{
SendClientMessage(playerid, COLOR_GREY, "Taxi Driver says: Welcome to the Taxi mate, please sit back and enjoy the ride.");
talkSentences = 0;
SetTimer("TaxiTalk", 60000, true);
}
And that should do it. Test it and tell me if it works.
Re: Talking bots -
Luis- - 21.05.2011
Thanks, works, Is there anyway I could freeze the bot until some one enters it?
Re: Talking bots -
Steve M. - 22.05.2011
How do you mean freeze the bot?
Re: Talking bots -
Luis- - 22.05.2011
Like using "TogglePlayerControllable" but used on the bot.
Re: Talking bots -
Luis- - 18.06.2011
Quote:
Originally Posted by -Luis
Like using "TogglePlayerControllable" but used on the bot.
|
Is this possible?
Re: Talking bots -
boelie - 18.06.2011
Sure..why not ?