How To Add A TIP Bot
#1

how to add a tip bot?
Reply
#2

A tip bot.. you mean like a NPC that gives you advice.. or like in hotel? come on.. be more clear
Reply
#3

uhm just like when players are walking around it the chat log says Tip Bot: Team Speak IP : 13221321321
Reply
#4

Run a timer, loop through all players, check if they're near the NPC's position, SendClientMessage and maybe a random() because you dont want the same messages all the time.
Reply
#5

I don't think he meant an NPC. Try this:
pawn Код:
public OnGameModeInit() {
   SetTimer("TipBot", (60000 * 10), true);
}

forward TipBot();
public TipBot() {
    new message = random(6);
    switch(message) {
        case 0: SendClientMessageToAll(COLOR_WHITE, "Tipbot: message 1");
        case 1: SendClientMessageToAll(COLOR_WHITE, "Tipbot: message 2");
        case 2: SendClientMessageToAll(COLOR_WHITE, "Tipbot: message 3");
        case 3: SendClientMessageToAll(COLOR_WHITE, "Tipbot: message 4");
        case 4: SendClientMessageToAll(COLOR_WHITE, "Tipbot: message 5");
        case 5: SendClientMessageToAll(COLOR_WHITE, "Tipbot: message 6");
        case 6: SendClientMessageToAll(COLOR_WHITE, "Tipbot: message 7");
    }
}
To add more, just increase the number in the brackets of the random function, and add more cases to the switch method.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)