Bot shoutout - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Bot shoutout (
/showthread.php?tid=276924)
Bot shoutout -
grand.Theft.Otto - 15.08.2011
Say every 1 minute, a random bot (i have 7) loops through all players and picks a random person. When the person talks, I want a random bot to say "stfu, %s" ( %s = person who talked).
Then the next minute, I want another random bot to pick another random person and say another random thing.
How would I do it? There are examples on Garsino's fun server, crazybobs, and some others, but I'm not too sure how to make it.
Re: Bot shoutout -
Jefff - 15.08.2011
init
pawn Код:
SetTimer("RandomTalk",60000,true);
pawn Код:
forward RandomTalk();
public RandomTalk()
{
new botid = Iter_Random(Bot);
new randomid = Iter_Random(Player);
new str[128],bot[24],nick[24];
GetPlayerName(botid,bot,24);
GetPlayerName(randomid,nick,24);
format(str,sizeof(str),"%s: stfu %s",bot,nick);
SendClientMessage(randomid,-1,str);
//or
//format(str,sizeof(str),"stfu %s",nick);
//SendPlayerMessageToPlayer(botid,randomid,str);
return 1;
}