DeadlySoldier!! Posted November 3, 2003 Report Posted November 3, 2003 Well im making a football bot, needing to know how i can make it so i can set the ball position.. Heres my idea with it.. 1. Well, for example, the Mod/Ref types !ball 44, it *setships the Mod/Ref to ship 8, warps the player to the ball coords, and then the 44 yard line. The problem is, i dunno how to get the coords of the ball.. Any help?? 2. I would like to use a !spec command to spec players. Yes i know !spec is a bot command to spec/unspec the bot, i will use !s or something. So i want it to do !s Deadly, and specs DeadlySoldier!! into spec (*spec). I know you have to make it look through the playerlist to find Deadly, but im not sure how. Also how can you make it so u do !s Dead and it looks for the closest person to what you typed? Thanks, -DeadlySoldier!!
ExplodyThingy Posted November 3, 2003 Report Posted November 3, 2003 if(c->check("s")){_listnode * parse = PlayerList.head;while(parse){if(parse->item->name == c->final){sendPrivate(parse>item,"*spec");sendPrivate(parse>item,"*spec");}parse = parse->next;}}
DeadlySoldier!! Posted November 4, 2003 Author Report Posted November 4, 2003 ..doesnt work i realized !s is a set command so i changed it to !aa and still doesnt work.. does that let u do !aa or just !aa and it doesnt check what you typed?
ExplodyThingy Posted November 4, 2003 Report Posted November 4, 2003 If you do !aa alone, itll never find a name, dont worry about it.What doesnt work? Paste error.
DeadlySoldier!! Posted November 4, 2003 Author Report Posted November 4, 2003 No no, it all compiles i do !aa DeadlySoldier!! and it doesnt do anything if(c->check("aa")) { _listnode <Player> * parse = playerlist->head; while(parse) { if(parse->item->name == c->final) { sendPrivate(parse->item,"*spec"); sendPrivate(p, "Player Specced"); } parse = parse->next; } }
»Dustpuppy Posted November 4, 2003 Report Posted November 4, 2003 if(c->check("s")) { _listnode <Player> * parse = PlayerList.head; while(parse) { if(0 == stricmp(parse->item->name, c->final)) { sendPrivate(parse>item,"*spec"); sendPrivate(parse>item,"*spec"); } parse = parse->next; } } parse->item->name and c->final are both char pointers, so you can't use an ==. If one was a string you could, or you could cast one to a string. If you changeif (0 == stricmp(parse->item->name, c->final))toif (cmpstart(parse->item->name, c->final))it should just check the start of the name, so you can use !aa Deadly and it will match DeadlySoldier.
DeadlySoldier!! Posted November 4, 2003 Author Report Posted November 4, 2003 command.cpp(159) : error C2065: 'cmpstart' : undeclared identifier :eek:
DeadlySoldier!! Posted November 4, 2003 Author Report Posted November 4, 2003 nvm that fixed, needs CMPSTART (in captials)
DeadlySoldier!! Posted November 4, 2003 Author Report Posted November 4, 2003 If you changeif (0 == stricmp(parse->item->name, c->final))toif (cmpstart(parse->item->name, c->final))it should just check the start of the name, so you can use !aa Deadly and it will match DeadlySoldier. Well the bot specs them now, but if (cmpstart(parse->item->name, c->final)) and if (0 == stricmp(parse->item->name, c->final)) both do the same thing, you have to type the full name.
DeadlySoldier!! Posted November 4, 2003 Author Report Posted November 4, 2003 Any clue about how to do the Ball thing?
»Dustpuppy Posted November 4, 2003 Report Posted November 4, 2003 Perhaps I got the paramaters to CMPSTART the wrong way round, but I'm pretty sure I remembered correctly...Try swapping the two. The "ball thing" isn't possible (unless perhaps the ball's momentum is disabled) as merv cannot determine the position of a ball. If it is being held by a player it knows where the ball is, so if it had no momentum after being dropped you would always know where it is. It would make for a crappy football game though.
DeadlySoldier!! Posted November 4, 2003 Author Report Posted November 4, 2003 remember NBA JAM? after every basket it would warp player to the ball then warp the player beside the net..
DeadlySoldier!! Posted November 4, 2003 Author Report Posted November 4, 2003 I was thinking.. What if i was to make the ball radius really big for ship 8, and restrict ship 8 to the mod/ref of thegame. but then again i dunno how to restrict it to mod/red
»Dustpuppy Posted November 5, 2003 Report Posted November 5, 2003 Hmm, not a bad idea.Just make the bot setship players who change to ship 8, unless p->access.
DeadlySoldier!! Posted November 5, 2003 Author Report Posted November 5, 2003 Ok i did it and it all worked. This should be good for now. Gonna get all the lvz and stuff set up now THANKS
DeadlySoldier!! Posted November 5, 2003 Author Report Posted November 5, 2003 Ok so i had some problems it wasnt doing everything, i relised it was, it was just doing *warpto then *spec right away REALLY fast so it didnt even get to the ball to move it.. Now i have it all working how i wanted it to.. just after like 4 times doing this you get dc'd for too many ship changes that just sucks man how can i fix that
»Dustpuppy Posted November 6, 2003 Report Posted November 6, 2003 Be a sysop?I'm surprised it happens at all with *setship
DeadlySoldier!! Posted November 6, 2003 Author Report Posted November 6, 2003 Well, i guess i could make the refs mods would that work?
»Dustpuppy Posted November 7, 2003 Report Posted November 7, 2003 Lol I was !@#$%^&*uming that all refs would be mods anyway
Recommended Posts