Jump to content
SubSpace Forum Network

Recommended Posts

Posted

In PlayerDeath, is there a way you can do ball->carrier?

 

i used:

 

if(ball->carrier != 65535) //This number means the ball is not being carried 

        { 

           _listnode <Player> *parse = playerlist->head; //list of all the player 

            

           while (parse) //go through list 

           { 

              if (ball->carrier == parse->item->ident)                 

              { //if you find the player with the ball 



                  	 if (parse->item->tile.x >= 346 && parse->item->tile.x <= 361 && parse->item->tile.y >= 453 && parse->item->tile.y <= 574) 

	 {

       sendPublic("*arena Touchdown! by " +(String)parse->item->name +".");

	 }

                 break; 

              } 

              parse = parse->next; //next player 

           } 

        }    

 

in BallMove, to detect if the player has the ball, now i want to make it check if they have the ball when they die.

 

How can i use ball->carrier in EVENT_PlayerDeath

 

Thx

Posted

this is what 1st came to my head

 

//where this is, in spawn.h

int countdown[4];



// Put bot data here



//add This to it<---------------------------

Uint16 BallCarrier; //a Uint16 being a unsigned short

, it will hold the ball carrier's ident

public:

botInfo(CALL_HANDLE given)

{

 handle = given;

 callback = 0;

 playerlist = 0;

 flaglist = 0;

 map = 0;

 countdown[0] = 0;

 countdown[1] = 0;

 countdown[2] = 0;

 countdown[3] = 0;

 CONNECTION_DENIED = false;

 me = 0;

 biller_online = true;

 num_objects = 0;

 object_dest = NULL;



 // Put initial values here

BallCarrier= -1; // <------------------belive this would work

}

 

then in your code above, thats in event ballmove

if(ball->carrier != 65535) //This number means the ball is not being carried 

        { 

           _listnode <Player> *parse = playerlist->head; //list of all the player 

             

           while (parse) //go through list 

           { 

              if (ball->carrier == parse->item->ident)                  

              { //if you find the player with the ball 

//Add this Here <-------------------------

BallCarrier= parse->item->ident; //!@#$%^&*ign a person's ident to the carrier





                          if (parse->item->tile.x >= 346 && parse->item->tile.x <= 361 && parse->item->tile.y >= 453 && parse->item->tile.y <= 574) 

        { 

                       sendPublic("*arena Touchdown! by " +(String)parse->item->name +"."); 

        } 

                 break; 

              } 

              parse = parse->next; //next player 

           } 

        }

 

that will keep track of who has the ball

 

then finally

case EVENT_PlayerDeath:

 {

	 Player *p = (Player*)event.p[0],

      *k = (Player*)event.p[1];

	 Uint16 bounty = (Uint16)event.p[2];

if(p->ident == BallCarrier) // <-------------------if they are holding the ball when they die

{

//your code here

}

 }

 break;

 

should work

Posted

no errors, but its not checking tiles to see if your in the rectangle that i have it set to when you die..

 

if (p->tile.x >= 363 && p->tile.x <= 365 && p->tile.y >= 453 && p->tile.y >= 575) sendPublic("*arena BLAH!");

 

i dont see anything wrong with that.. but its not checking

Posted

you can do this then, in your ball move code

         if (parse->item->tile.x >= 346 && parse->item->tile.x <= 361 && parse->item->tile.y >= 453 && parse->item->tile.y <= 574) 

        { 

            BallCarrier= parse->item->ident; 

            sendPublic("*arena Touchdown! by " +(String)parse->item->name +"."); 

        } 

        else

        {

           BallCarrier=-1;

        }

that will only record the person if they are inside the area, and if they arnt, then it wont record them

Posted

hmm how do u do it so u type !blah and it warps u to where the ball is?

 

     if (c->check("blah"))

	 {

   sendPrivate(p, "*setship 1");

   sendPrivate(p, "*warpto " +(String)PBall.x +(String)PBall.y);

     }

 

obviously u cant use PBall.x and PBall.y

 

command.cpp(147) : error C2275: 'PBall' : illegal use of this type as an expression

 

how ?

Posted

<thinks of his code>

 

if (p == ballc) { ... };

 

=P

 

like is said... no1 listens to me

Posted
hmm how do u do it so u type !blah and it warps u to where the ball is?

 

     if (c->check("blah"))

	 {

   sendPrivate(p, "*setship 1");

   sendPrivate(p, "*warpto " +(String)PBall.x +(String)PBall.y);

     }

 

obviously u cant use PBall.x and PBall.y

 

command.cpp(147) : error C2275: 'PBall' : illegal use of this type as an expression

 

how ?

 

You cant find the ball's coords if its not being held by someone.

Posted
<thinks of his code>

 

if (p == ballc) { ... };

 

=P

 

like is said... no1 listens to me

 

Post it. (Your Code)

 

-nintendo64

 

i already told him in another thread to use my code and posted it...

but well, i guess he likes it complicated.

 

k0zy

Posted
nt

nt is how to know if the ballcarier died...

and thats what i told him

Posted
You cant find the ball's coords if its not being held by someone.

 

Erm well u know SSN NBA JAM (dunno if its still up).. well it used to have a basketball bot.. it did this:

 

when a basket it scored, it chose a player, warped the player to the location of the ball then warped them again..

 

now, im trying to do !blah, then it warps you to position of ball then it warps you again..

Posted
Erm well u know SSN NBA JAM (dunno if its still up).. well it used to have a basketball bot.. it did this:

 

when a basket it scored, it chose a player, warped the player to the location of the ball then warped them again..

 

now, im trying to do !blah, then it warps you to position of ball then it warps you again..

 

thats because when the goal was made, the ball was reset back to its original pos!@#$%^&*ion and that original position is always the same.

Posted
its up i have the dll for it. the maker of the plugin is VampZ last i know he works in Hockey zone making thier bots i would give u the plugin and let u see it but i cant make it public
Posted
its up i have the dll for it. the maker of the plugin is VampZ last i know he works in Hockey zone making thier bots i would give u the plugin and let u see it but i cant make it public

 

i already have it you gave it to me soi could host

Guest
This topic is now closed to further replies.
×
×
  • Create New...