View Single Post
Seren Seren's Avatar

JCF Member

Joined: Feb 2010

Posts: 864

Seren is a name known to allSeren is a name known to allSeren is a name known to allSeren is a name known to allSeren is a name known to allSeren is a name known to all

Aug 17, 2013, 09:16 AM
Seren is offline
Reply With Quote
This is another possible solution that has insignificantly longer execution time but doesn't use global variables and is more flexible (can be used for players who aren't local):
Code:
bool playerHasShot(jjPLAYER@ player){
  jjOBJ@ obj;
  for(int i=0;i<jjObjectCount;i++){
    @obj=jjObjects[i];
    if(obj.isActive&&(obj.eventID<OBJECT::SMOKERING||obj.eventID==OBJECT::TNT)&&obj.creatorType==CREATOR::PLAYER&&jjPlayers[obj.creator] is player&&(obj.state==STATE::FLY||obj.state==STATE::ROCKETFLY)&&obj.counter==1) return true;
  }
  return false;
}
__________________

I am an official JJ2+ programmer and this has been an official JJ2+ statement.

Last edited by Sir Ementaler; Aug 17, 2013 at 03:15 PM.