Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ($("#p2stats").length == 0)
- {
- $("#wager").after('<button id="Bet100" type="button">Max</button>')
- $("#wager").after('<button id="Bet75" type="button">75%</button>')
- $("#wager").after('<button id="Bet50" type="button">50%</button>')
- $("#wager").after('<button id="Bet25" type="button">25%</button>')
- $("#wager").after('<button id="Bet10" type="button">10%</button>')
- $("#wager").after('<br/><button id="Bet1" type="button">1</button>')
- $("#Bet1").click(function()
- {
- $("#wager").val("1")
- });
- $("#Bet10").click(function()
- {
- $("#wager").val(Math.floor($("#balance").text() * .1))
- });
- $("#Bet25").click(function()
- {
- $("#wager").val(Math.floor($("#balance").text() * .25))
- });
- $("#Bet50").click(function()
- {
- $("#wager").val(Math.floor($("#balance").text() * .5))
- });
- $("#Bet75").click(function()
- {
- $("#wager").val(Math.floor($("#balance").text() * .75))
- });
- $("#Bet100").click(function()
- {
- $("#wager").val($("#balance").text())
- });
- $("#p1name").after("<br><span id=\"p1stats\">Salty Stat Tracker Loaded</span>");
- $("#p2name").after("<br><span id=\"p2stats\">Salty Stat Tracker Loaded</span>");
- $("#p1stats").next("br").remove();
- $("#p2stats").next("br").remove();
- $('#p2name').addClass('right')
- $('#p2stats').addClass('right')
- $("#p2name").bind("DOMSubtreeModified",p2name_Changed);
- }
- function p2name_Changed (event)
- {
- $.ajax(
- {
- type: "get",
- url: "ajax_get_stats.php",
- data: "",
- dataType: "json",
- cache: "false",
- timeout: 1000,
- success: function (data)
- {
- p1name = data.p1name;
- p1totalmatches = data.p1totalmatches;
- p1winrate= data.p1winrate;
- p1tier = data.p1tier;
- p1life = data.p1life;
- p1meter = data.p1meter;
- p2name = data.p2name;
- p2totalmatches = data.p2totalmatches;
- p2winrate = data.p2winrate;
- p2tier = data.p2tier;
- p2life = data.p2life;
- p2meter = data.p2meter;
- $("#p1stats").text("Tier: " + p1tier + " Matches: " + p1totalmatches + " Win: " + p1winrate + "%" + " Life: " + p1life);
- $("#p2stats").text("Tier: " + p2tier + " Matches: " + p2totalmatches + " Win: " + p2winrate + "%" + " Life: " + p2life);
- }
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment