Witchie NL Posted March 9, 2006 Report Posted March 9, 2006 ok i got 2 things to say which i found out during programming a ballgame bot.the EVENT_SoccerGoal is to slow if you want the bot to awnser "!cgive :5000" and you score 2 goals within 4 secs it doesnt count the second goal . Well becouse doesnt seem to work i pimped the event a bit but now i found another problem.I made it such a way that all the player who are willing to goal need to sign up with a commands so they get setfreqed to a private freq (1v1v1v1 style). now i need to create the plugin such a way that it setfreqs everyone in a diferent frequency.this is what i came up to: if (c->check("joinball")) int i = 100; { sendPrivate(p, "*setfreq " + String(i)); sendPrivate(p, "Good luck playing. SCORE THOSE GOALS!"); i++; } The only thing it sais now is:Bot> *setfreq 100Bot> Good luck playing. SCORE THOSE GOALS! Its coused becouse of the fact int i = 0; gets repeated every time someone usees !joinball.Puting "int i = 100;" before "if (c->check("joinball"))" somehow also doesnt work . Does anyone know a solution? For more scrypting details: MSN: peeps_are_!@#$%^&*@hotmail.comINGAME: Witchie NL (Probebly in SSCC Desert Storm.)
Witchie NL Posted March 9, 2006 Author Report Posted March 9, 2006 help! Realy such a small bug and i cant fix it. God i hate when this happens.
»D1st0rt Posted March 9, 2006 Report Posted March 9, 2006 If you put i (I suggest renaming it) in spawn.h initialized to 0, you should be able to change your code to:if (c->check("joinball")) { sendPrivate(p, "*setfreq " + String(100 + (i % 4))); sendPrivate(p, "Good luck playing. SCORE THOSE GOALS!"); i++; }
Witchie NL Posted March 9, 2006 Author Report Posted March 9, 2006 ok i dont get this dud duno if its me . prob me, my english isnt realy well. Ok ill contact you ingame. dont know what you ment with the spawn.h thing but the only thing it needs to do is send every person who uses !joinball, setfreq to all diferent freq's. Example: Person1> !joinball bot> *setfreq 101 Person2> !joinball bot> *setfreq 102 Person3> !joinball bot> *setfreq 103 etc..etc..
Witchie NL Posted March 12, 2006 Author Report Posted March 12, 2006 no i dont now the freqs 100 to 200 are registered, but i got another question:If i do !stopball everyone is still in that private freq, but they need to be put back to freq 0 and freq 1 to keep them even. anyone an idea how to setfreq half of the players to freq 1 and the other half to freq 0 if you do !stopball?
»D1st0rt Posted March 12, 2006 Report Posted March 12, 2006 Something like this ought to do the trickif (c->check("stopball")) { //using the same variable as before is an easy way to reset it i = 1; //for each player, do this: { if(freq >= 100) sendPrivate(p, "*setfreq " + String(i ^= 1); } }
Witchie NL Posted March 13, 2006 Author Report Posted March 13, 2006 ill try that, hope it works.... ty
Witchie NL Posted March 13, 2006 Author Report Posted March 13, 2006 ok dude i created it and this is what i came with in command.cpp:if (c->check("stopball")) /// check command for stop { startball = false; sendPrivate(p, "Now see what you've done, Now it stoped!"); /// stoped sendPublic(SND_Scream, ".*arena Ballgame has now ended. Thank you for playing and enjoy your stay at DS. - DSstaff"); sendPublic(SND_Scream, ".*arena Ballgame has now ended. Thank you for playing and enjoy your stay. - DSstaff"); sendPublic(SND_Scream, ".*arena Ballgame has now ended. Thank you for playing and enjoy your stay at DS. - DSstaff"); int i = 1; { if(freq >= 100) sendPrivate(p, "*setfreq " + String(i ^= 1)); } } now when i try to compile it gives the error:e:\mervbot\src\ballgame\command.cpp(197) : error C2065: 'freq' : undeclared identifiersounds logical with me coz freq isnt an defined integer... Do i miss something in spawn.h?
»D1st0rt Posted March 13, 2006 Report Posted March 13, 2006 Oh sorry, that needs to be p->team. You should put the freq check/setfreq inside one of these blocks:http://wiki.minegoboom.com/index.php/MERVB...through_players
Recommended Posts