Results 1 to 5 of 5
  1. #1

    BF1 Stat Banners

    Hello all,

    I am working on doing some stat banners for our clan I have successfully made some basic ones.

    however, i am looking at getting a little more in-depth with it.

    for example, if I use pd.player.rank.imgLarge this only shows low level ranks not 120.
    I have seen other banners which show this so I know this is possible.

    example 1 lvl 120


    example 2 lvl 30



    also, i am wanting to add in best weapon, Vehicle, Class & game mode without any luck.

    can anyone point me in a direction???

  2. #2
    Administrator HigH_HawK's Avatar
    Join Date
    2006-03-15
    Location
    UK / GER
    Posts
    1,347

    Re: BF1 Stat Banners

    Hi SYD_Stealthy,

    regarding the large rank images, I have to look into this a little more in depth but regarding the other question about the top vehicle, weapon and class, please use the following code snippets. You just have to amend the x,y axes and the h,w sizes.

    Code:
    //Favorite Weapons
    
    function favWeapon( pd ) {
    	if ( !pd ) return null;
    	top = 0;
    	for ( i = 0; i < pd.weapons.length; i++ ) {
    		if ( pd.weapons[ i ].stat.kills > top ) {
    			top = pd.weapons[ i ].stat.kills;
    			fav = pd.weapons[ i ];
    		}
    	}
    	return fav;
    }
    
    wfav = favWeapon( pd );
    image( {
    	x: 347,
    	y: 35,
    	file: wfav.img,
    	w: 95,
    	h: 26
    } );
    
    var favWeaponKills = wfav.stat.kills + ' kills'
    wfavkills = text( {
    	x: 398,
    	y: 90,
    	text: favWeaponKills,
    	size: 10
    } );
    
    //Fav Vehicles
    
    function favVehicle( pd ) {
    	if ( !pd ) return null;
    	top = 0;
    	for ( i = 0; i < pd.vehicles.length; i++ ) {
    		if ( pd.vehicles[ i ].stat.kills > top ) {
    			top = pd.vehicles[ i ].stat.kills;
    			fav = pd.vehicles[ i ];
    		}
    	}
    	return fav;
    }
    
    vfav = favVehicle( pd );
    image( {
    	x: 455,
    	y: 35,
    	file: vfav.img,
    	w: 85,
    	h: 35
    } );
    
    var favVehicleKills = vfav.stat.kills + ' kills'
    vfavkills = text( {
    	x: 499,
    	y: 90,
    	text: favVehicleKills,
    	size: 10
    } );
      
      
      // Fav. kit
    var score2kit = {
        Assault: pd.kits[0].stat.score,
        Medic: pd.kits[1].stat.score,
        Support: pd.kits[2].stat.score,
        Scout: pd.kits[3].stat.score,
        Pilot: pd.kits[4].stat.score,
        Tanker: pd.kits[5].stat.score,
        Cavalry: pd.kits[6].stat.score,
        Elite: pd.kits[7].stat.score
        };
    
    var favkit = 'ASSAULT';
    var favkitscore = 0;
    for (var kit in score2kit) {
        if (score2kit[kit] <= favkitscore) continue;
        favkitscore = score2kit[kit];
        favkit = kit;
    }
    
    //Kit text output
    text({x:394, y:139, align:'center', text:favkit});
    
    //Game Mode
    
    var topGameMode = {
        Conquest: pd.gameModes.conquest.extra.rounds,
        Domination: pd.gameModes.domination.extra.rounds,
        Operations: pd.gameModes.operations.extra.rounds,
        Rush: pd.gameModes.rush.extra.rounds,
        TDM: pd.gameModes.tdm.extra.rounds,
        WarPigeons: pd.gameModes.warpigeons.extra.rounds
        };
    
    var topGame = "War Pigeons";
    var roundsPlayed = 0;
    
    for (var rounds in topGameMode) {
        if (topGameMode[rounds] <= roundsPlayed) continue;
        roundsPlayed = topGameMode[rounds];
        topGame = rounds;
    }
    
    //Kit text output
    text({x:499, y:139, align:'center', text:topGame});
    
    }

  3. #3
    Administrator 1ApRiL's Avatar
    Join Date
    2011-02-12
    Location
    Waiblingen, Germany
    Posts
    1,515
    BFBC2 PC
    1ApRiL
    NFS World
    1APRIL
    BF2
    1ApRiL
    BF3 PC
    1ApRiL

    Re: BF1 Stat Banners

    I added the new rank images now.
    Admin of bfhstats.com / bf4stats.com / bf3stats.com | Twitter

  4. #4

    Re: BF1 Stat Banners

    Hi 1ApRiL,

    thank you for looking into my request on the rank images they are now working.
    I will be looking at your provided code soon.

    once again thank you.

  5. #5

    Re: BF1 Stat Banners

    Hi, 1 ApRil,

    Thank you once again for your help I have created two banners, my clan banner and one without our clan info on it for others to use.

    Just a quick question, I have noticed that the banners will not find any players name unless someone has searched for that name inside your main page. so once a name has been searched then the banner will work.

    is this correct??

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
P-STATS NETWORK FORUM LOGIN CREATE ACCOUNT