Server Help

Bot Questions - Bounty Command

xsp0rtsfanx - Sun Sep 11, 2005 10:28 pm
Post subject: Bounty Command
Is there a command or a way to make a bot or something prize you when you have a certain amount of bounty? I'm trying to make a mini plugin and I could figure out the code if I knew if there was a command to check for bounty through the bot.
Purge - Sun Sep 11, 2005 10:45 pm
Post subject:
In MERV, you'd do something like this:
Code: Show/Hide
if (p->bounty == x)
{
      sendPrivate(p, *prize ##);
}

xsp0rtsfanx - Mon Sep 12, 2005 12:41 am
Post subject:
yea i'm using merv. i thought something like that wouldnt work because i didnt think it would detect the bounty. so if i wanted an arena message to say when a person got killed with a lot of bounty or whatever it would look like this

Code: Show/Hide

If {p->bounty => x}
            sendPublic{p, *arena %tickname was killed by %name after having                   x bounty};
}

or is that like way off.. also how would it detect if a person got killed

(ps is it => or >= for greater than or equal to)

Bak - Mon Sep 12, 2005 1:04 am
Post subject:
it's just like it's said, greater than or equal to (>=). Nonetheless you could have tested this out instead of asking, as only one of them will compile
Maverick - Mon Sep 12, 2005 6:28 am
Post subject:
If you want to have it detect bounty reliable, set 'NoisySpectator' to 1 in mervbot.ini. (And then you can detect the bounty in the EVENT_PlayerMove Event)

However, beware of the warnings given by 50% Packetloss about NoisySpectator in this topic.

Can a mod please move this topic to Bot Questions forum icon_confused.gif
Cyan~Fire - Mon Sep 12, 2005 8:33 pm
Post subject:
NoisySpectator is almost always a bad idea. However, bounty only goes up during kills and prizes (right?) so all you have to do is check on EVENT_PlayerDeath and EVENT_PlayerPrize. Come on, Mav, use your brain.

The one possible circumstance in which this might not work is the smod command *prize, I'm not sure whether that sends a player prize packet. Of course, you could always check on EVENT_PlayerPosition without NoisySpectator if you want.
Quan Chi2 - Mon Sep 12, 2005 8:33 pm
Post subject:
:/
xsp0rtsfanx - Mon Sep 12, 2005 9:37 pm
Post subject:
ok so literally heres how my code should look.. or would this be way wrong

Code: Show/Hide


If {p >= x}
{
         sendPrivate {*prize #};
}

If {EVENT_playerdeath p >= x}
{
        sendPublic {*arena Player has been killed after having x bounty};
}


also would this go under a .cpp file or .c file?
Muskrat - Mon Sep 12, 2005 9:46 pm
Post subject:
That would be WAY wrong. First you have braces, { and } where there should be parentheses, ( and ). Also, dont capitalize keywords (if not If). You need a player argument first, then a string in the sendPrivate function. Also, get the capitalizing on EVENT_PlayerDeath right. And in your first conditional p isnt going to compare with any integer x, so I'd suggest p->bounty, that looks liek what you are going for.


jesus... lol I don't even think thats everything.
Quan Chi2 - Mon Sep 12, 2005 10:04 pm
Post subject:
I would use something like..
String s;
s += "arena ";

blah blah blah
xsp0rtsfanx - Mon Sep 12, 2005 10:18 pm
Post subject:
alright thanks for the help thus far.. i'm still trying to learn c++ so i'm getting there gradually tongue.gif
Cyan~Fire - Mon Sep 12, 2005 11:05 pm
Post subject:
Learn C++ before you make a bot plugin. Look at some other plugins or read stuff on http://www.cplusplus.com/doc/.
Muskrat - Mon Sep 12, 2005 11:50 pm
Post subject:
Or better yet, take an Intro to C class at your school or nearby university.
xsp0rtsfanx - Mon Sep 12, 2005 11:56 pm
Post subject:
my school: highschool that has a java course they wouldnt let me in

nearby university/community college: no class i dont believe...

i'd have to search to find a class.. i have books so i'm gradually learning..
Purge - Tue Sep 13, 2005 3:21 pm
Post subject:
Yeah, C++ for Dummies is helping me much.
D1st0rt - Wed Sep 14, 2005 10:37 pm
Post subject:
If you can't understand at least the first several sections of this, stop until you do:

http://computer.howstuffworks.com/c.htm
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group