 |
Server Help Community forums for Subgame, ASSS, and bots
|
Author |
Message |
bugzap Guest
Offline
|
Posted: Thu Nov 09, 2006 9:23 pm Post subject: In MERVBot - if(player has multifire) |
 |
|
|
|
In MERVBot how can I ask if player has PRIZE_Multifire its not listed below
p->multifire - would do it but its not lised
p->(burst repel, thor, brick, decoy, rocket, portal) = how many items of that type player has
p->(stealth, cloak, xradar, awarp, ufo, flash, safety, shields, supers) = if player has that item on (boolean)
multifire is awarded by the bot, but dont want it awared twice, so need to know if its already been awarded to that player. |
|
Back to top |
|
 |
Cerium Server Help Squatter

Age:42 Gender: Joined: Mar 05 2005 Posts: 807 Location: I will stab you. Offline
|
Posted: Fri Nov 10, 2006 12:03 am Post subject: |
 |
|
|
|
It's not something that is ever reported by the client. Basically you have two options:
(1) If the prize factor for multifire is set so players cannot naturally find one, then all you have to do is keep a list of players you have given the prize to. As they die or change ships/freqs remove them from the list.
(2) Similar to above, but rather than adding the players to the list when the bot prizes them, you can handle one of the prize packets (don't remember which) and add the player to the list when they get a multifire prize. _________________ There are 7 user(s) ignoring me right now. |
|
Back to top |
|
 |
Muskrat Server Help Squatter

Age:38 Joined: Aug 24 2004 Posts: 829 Location: Swamp Offline
|
Posted: Fri Nov 10, 2006 1:13 am Post subject: |
 |
|
|
|
couldn't you watch weapons as well? |
|
Back to top |
|
 |
Witchie NL Seasoned Helper
Age:35 Gender: Joined: Jul 24 2005 Posts: 112 Location: Veere, Zeeland, Netherlands Offline
|
Posted: Fri Nov 10, 2006 2:52 am Post subject: |
 |
|
|
|
yes in weapon part see if someonce has fired a multifire bulet. |
|
Back to top |
|
 |
bugzap Guest
Offline
|
Posted: Fri Nov 10, 2006 3:15 am Post subject: |
 |
|
|
|
ok some ideas there,
I need to know if theirs a better way to go about this or if im on the right track.
Im using player bounty to give prizes.
//-----------------------------------------
Player starts at 100 bty
50 bty for each kill
3 kills = 250 bty (give prize)// lame prize
8 kills = 500 bty (give prize)// multi/bounce something good
18 kills = 1000 bty (give prize)// reset all inital weaponds for that ship (burst/repel/portal etc.) + nrg/prize updates.
2000 bty, 3000bty etc. repeat..
========================================
if (p->ship != SHIP_Spectator)
{
/*--------for testing-------*/
//sendPrivate(p, "*prize 50");
/*---------------*/
if (p->ship == SHIP_Warbird){sendPrivate(p, "You Are In SHIP_Warbird");}
else if (p->ship == SHIP_Javelin){sendPrivate(p, "You Are In SHIP_Javelin");}
else if (p->ship == SHIP_Spider){sendPrivate(p, "You Are In SHIP_Spider");}
else if (p->ship == SHIP_Leviathan){sendPrivate(p, "You Are In SHIP_Leviathan");}
else if (p->ship == SHIP_Terrier){sendPrivate(p, "You Are In SHIP_Terrier");}
/////////
else if (p->ship == SHIP_Weasel)
{
if (p->bounty > 235 && p->bounty < 265)
{
sendPrivate(p, "Here ya go, multifire.");
sendPrivate(p, "*prize #15");
}
else if (p->bounty > 480 && p->bounty < 520)
{
sendPrivate(p, "Here ya go, Super.");
sendPrivate(p, "*prize #17");
}
else if (p->bounty > 975 && p->bounty < 1025)
{
sendPrivate(p, "Here ya go, Super.");
sendPrivate(p, "*prize #17");
}
else if (p->bounty > 1970 && p->bounty < 2030)
{
sendPrivate(p, "Here ya go, Super.");
sendPrivate(p, "*prize #17");
}
}
///////////
else if (p->ship == SHIP_Lancaster){sendPrivate(p, "You Are In SHIP_Lancaster");}
else if (p->ship == SHIP_Shark){sendPrivate(p, "You Are In SHIP_Shark");}
}//if not in spec close
=================================
|
Basicly if i could just track kills.. on 3rd kill *prize on 10th kill *prize etc..
Thanks for your time! |
|
Back to top |
|
 |
Witchie NL Seasoned Helper
Age:35 Gender: Joined: Jul 24 2005 Posts: 112 Location: Veere, Zeeland, Netherlands Offline
|
Posted: Fri Nov 10, 2006 4:18 am Post subject: |
 |
|
|
|
or use tag's. But this will work aswell yes. if you implent it in EVENT_PlayerDeath. And change the sendPrivate(p, in a k |
|
Back to top |
|
 |
BugZap Guest
Offline
|
|
Back to top |
|
 |
BugZap Guest
Offline
|
Posted: Fri Nov 10, 2006 7:48 am Post subject: |
 |
|
|
|
Here's what I ended up with, still needs configured for each ship etc.
Issue:
Apparently when a player dies they leave a green by default?
If the zone isn't setup for that, it will vanish almost instantly,
but close kills can result in the killer greening
which throws of the evenly numbered bty
Could try and round off the bty? dunno, then we could just ask if( k->bounty == x ) but..
Could also put this crap in a Array of some sort to cut down its size ,
but I dont think var new Array() will work here, and I dont know c+ well enuff.
if (k->ship == SHIP_Warbird)
{
if (k->bounty > 235 && k->bounty < 265)
{
sendPrivate(k, "*prize #15");
}
else if (k->bounty > 480 && k->bounty < 520)
{
sendPrivate(k, "*prize #17");
}
else if (k->bounty > 975 && k->bounty < 1025)
{
sendPrivate(k, "*prize #17 - Here ya go, Super.");
}
else if (k->bounty > 1970 && k->bounty < 2030)
{
sendPrivate(k, "*prize #17");
}
}
else if (k->ship == SHIP_Javelin)
{
if (k->bounty > 235 && k->bounty < 265)
{
sendPrivate(k, "*prize #15");
}
else if (k->bounty > 480 && k->bounty < 520)
{
sendPrivate(k, "*prize #17");
}
else if (k->bounty > 975 && k->bounty < 1025)
{
sendPrivate(k, "*prize #17 - Here ya go, Super.");
}
else if (k->bounty > 1970 && k->bounty < 2030)
{
sendPrivate(k, "*prize #17");
}
}
else if (k->ship == SHIP_Spider)
{
if (k->bounty > 235 && k->bounty < 265)
{
sendPrivate(k, "*prize #15");
}
else if (k->bounty > 480 && k->bounty < 520)
{
sendPrivate(k, "*prize #17");
}
else if (k->bounty > 975 && k->bounty < 1025)
{
sendPrivate(k, "*prize #17 - Here ya go, Super.");
}
else if (k->bounty > 1970 && k->bounty < 2030)
{
sendPrivate(k, "*prize #17");
}
}
else if (k->ship == SHIP_Leviathan)
{
if (k->bounty > 235 && k->bounty < 265)
{
sendPrivate(k, "*prize #15");
}
else if (k->bounty > 480 && k->bounty < 520)
{
sendPrivate(k, "*prize #17");
}
else if (k->bounty > 975 && k->bounty < 1025)
{
sendPrivate(k, "*prize #17 - Here ya go, Super.");
}
else if (k->bounty > 1970 && k->bounty < 2030)
{
sendPrivate(k, "*prize #17");
}
}
else if (k->ship == SHIP_Terrier)
{
if (k->bounty > 235 && k->bounty < 265)
{
sendPrivate(k, "*prize #15");
}
else if (k->bounty > 480 && k->bounty < 520)
{
sendPrivate(k, "*prize #17");
}
else if (k->bounty > 975 && k->bounty < 1025)
{
sendPrivate(k, "*prize #17 - Here ya go, Super.");
}
else if (k->bounty > 1970 && k->bounty < 2030)
{
sendPrivate(k, "*prize #17");
}
}
/* -- sendPublic((String)k->bounty) -- FOR TESTING -- SHIP_Weasel ONLY -*/
else if (k->ship == SHIP_Weasel)
{
if (k->bounty > 235 && k->bounty < 265)
{
sendPublic((String)k->bounty);
sendPrivate(k, "*prize #15");
}
else if (k->bounty > 480 && k->bounty < 520)
{
sendPublic((String)k->bounty);
sendPrivate(k, "*prize #17");
}
else if (k->bounty > 975 && k->bounty < 1025)
{
sendPublic((String)k->bounty);
sendPrivate(k, "*prize #17 - Here ya go, Super.");
}
else if (k->bounty > 1970 && k->bounty < 2030)
{
sendPublic((String)k->bounty);
sendPrivate(k, "*prize #17");
}
}
else if (k->ship == SHIP_Lancaster)
{
if (k->bounty > 235 && k->bounty < 265)
{
sendPrivate(k, "*prize #15");
}
else if (k->bounty > 480 && k->bounty < 520)
{
sendPrivate(k, "*prize #17");
}
else if (k->bounty > 975 && k->bounty < 1025)
{
sendPrivate(k, "*prize #17 - Here ya go, Super.");
}
else if (k->bounty > 1970 && k->bounty < 2030)
{
sendPrivate(k, "*prize #17");
}
}
else if (k->ship == SHIP_Shark)
{
if (k->bounty > 235 && k->bounty < 265)
{
sendPrivate(k, "*prize #15");
}
else if (k->bounty > 480 && k->bounty < 520)
{
sendPrivate(k, "*prize #17");
}
else if (k->bounty > 975 && k->bounty < 1025)
{
sendPrivate(k, "*prize #17 - Here ya go, Super.");
}
else if (k->bounty > 1970 && k->bounty < 2030)
{
sendPrivate(k, "*prize #17");
}
}
|
|
|
Back to top |
|
 |
Muskrat Server Help Squatter

Age:38 Joined: Aug 24 2004 Posts: 829 Location: Swamp Offline
|
|
Back to top |
|
 |
BugZap Guest
Offline
|
Posted: Fri Nov 10, 2006 7:00 pm Post subject: |
 |
|
|
|
Well, its the whole code..
In case some noob like me comes along and would like to use it. |
|
Back to top |
|
 |
Solo Ace Yeah, I'm in touch with reality...we correspond from time to time.

Age:37 Gender: Joined: Feb 06 2004 Posts: 2583 Location: The Netherlands Offline
|
|
Back to top |
|
 |
BugZap Guest
Offline
|
Posted: Sat Nov 11, 2006 10:38 pm Post subject: |
 |
|
|
|
Check the shiptype to give diffrent prizes to diffrent ships, and Muskrat's code is the code I wrote, tho Im not so proud of it. And Im a Guest at these forums, not a member.
They should neuter chimps like you. |
|
Back to top |
|
 |
Muskrat Server Help Squatter

Age:38 Joined: Aug 24 2004 Posts: 829 Location: Swamp Offline
|
Posted: Sat Nov 11, 2006 11:40 pm Post subject: |
 |
|
|
|
Making all those redundant comparisons is still more work than it should be. Use variables for the prize numbers, set the variables in a k->ship switch, then run that code once after it.
When I(and I presume Solo as well) saw a block of code I skipped your sentence about different prizes and thought you were doing something stupid.
Mi apologia!
Also, If you really just want to do it by number of kills, use player tags and increment k's tag. Then you can do a if(get_tag(k, TAG_KILLS)%3(or whatever) == 0){...prize 100*(get_tag(k, TAG_KILLS)/3);}. |
|
Back to top |
|
 |
BugZap Guest
Offline
|
Posted: Sun Nov 12, 2006 1:11 am Post subject: |
 |
|
|
|
No apologies necessary here, Im just here goofing around trying to learn this stuff, so I can add my name to the list of failed zones someday.. lol
I did finally figure out the tag thing (very useful!). You no doubt are right, its the way to go.
Ill work out the redundancies at some point.
case EVENT_PlayerDeath:
{
Player *p = (Player*)event.p[0],
*k = (Player*)event.p[1];
Uint16 bounty = (Uint16)(Uint32)event.p[2];
Uint16 flags = (Uint16)event.p[3];
set_tag(p, KILLS, 0);
set_tag(k, KILLS, get_tag(k, KILLS) + 1);
if (get_tag(k, KILLS) == 5)
{
if (k->ship == SHIP_Warbird)
{}
else if (k->ship == SHIP_Javelin)
{}
else if (k->ship == SHIP_Spider)
{}
else if (k->ship == SHIP_Leviathan)
{}
else if (k->ship == SHIP_Terrier)
{}
else if (k->ship == SHIP_Weasel)
{sendPublic("5 kills");}
else if (k->ship == SHIP_Lancaster)
{}
else if (k->ship == SHIP_Shark)
{}
}
else if (get_tag(k, KILLS) == 10)
{
if (k->ship == SHIP_Warbird)
{}
else if (k->ship == SHIP_Javelin)
{}
else if (k->ship == SHIP_Spider)
{}
else if (k->ship == SHIP_Leviathan)
{}
else if (k->ship == SHIP_Terrier)
{}
else if (k->ship == SHIP_Weasel)
{sendPublic("10 kills");}
else if (k->ship == SHIP_Lancaster)
{}
else if (k->ship == SHIP_Shark)
{}
}
if (get_tag(k, KILLS) == 15)
{
if (k->ship == SHIP_Warbird)
{}
else if (k->ship == SHIP_Javelin)
{}
else if (k->ship == SHIP_Spider)
{}
else if (k->ship == SHIP_Leviathan)
{}
else if (k->ship == SHIP_Terrier)
{}
else if (k->ship == SHIP_Weasel)
{sendPublic("15 kills");}
else if (k->ship == SHIP_Lancaster)
{}
else if (k->ship == SHIP_Shark)
{}
}
}
break;
|
|
|
Back to top |
|
 |
Muskrat Server Help Squatter

Age:38 Joined: Aug 24 2004 Posts: 829 Location: Swamp Offline
|
|
Back to top |
|
 |
Guest
Offline
|
Posted: Sun Nov 12, 2006 2:31 am Post subject: |
 |
|
|
|
To be honest, Im not sure of the final setup. Dividing by 5 would work out nicely, but like I said not sure of the final setup yet. After 3rd prize at 1000 bty it might not prize again till 1500, or 2000 bty.
I did write a chunk of code using switch case, it breaks after finding the ship, alittle less work. But I guess for now atleast ill just leave it hard coded till i figure out where im going with this zone.
Maybe in the end ill try a plugin that can be easily setup whatever way in a ini file, but thats a ways off.
Thanks for you insight, |
|
Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
Software by php BB © php BB Group Server Load: 180 page(s) served in previous 5 minutes.
|