def saycommand_bet(playerinfo, teamonly, command):
    global bets
    player = PlayerEntity(index_from_playerinfo(playerinfo))

    params = str(command[1]).split(" ")

    if len(params) == 3:
        team = params[1]
        amount = params[2]

        team_number = player.team
#        team_number = 1 # For Testing

        # Check if player is spectator
        if team_number == 1:

            if int(amount) >= 100:
                if team == "t":
                    SayText2(message="PAYOUT - " + amount + " SAT - T WIN").send(index_from_playerinfo(playerinfo))
                    leetcoin_client.requestAward(-int(amount), "PAYOUT - " + amount + " SAT - T WIN", userid_from_playerinfo(playerinfo))
                    bets['t'][userid_from_playerinfo(playerinfo)] = int(amount)
                if team == "ct":
                    SayText2(message="PAYOUT - " + amount + " SAT - CT WIN").send(index_from_playerinfo(playerinfo))
                    leetcoin_client.requestAward(-int(amount), "PAYOUT - " + amount + " SAT - CT WIN", userid_from_playerinfo(playerinfo))
                    bets['ct'][userid_from_playerinfo(playerinfo)] = int(amount)
            else:
                SayText2(message="Minimum bet is 100 SAT").send(index_from_playerinfo(playerinfo))
        else:
            SayText2(message="Only spectators can bet").send(index_from_playerinfo(playerinfo))
    else:
        SayText2(message="Type: bet <team> <amount>").send(index_from_playerinfo(playerinfo))
def saycommand_bet(playerinfo, teamonly, command):
    global bets
    player = PlayerEntity(index_from_playerinfo(playerinfo))

    params = str(command[1]).split(" ")

    if len(params) == 3:
        team = params[1]
        amount = params[2]

        team_number = player.team
#        team_number = 1 # For Testing

        # Check if player is spectator
        if team_number == 1:

            if int(amount) >= 100:
                if team == "t":
                    SayText2(message="PAYOUT - " + amount + " SAT - T WIN").send(index_from_playerinfo(playerinfo))
                    leetcoin_client.requestAward(-int(amount), "PAYOUT - " + amount + " SAT - T WIN", userid_from_playerinfo(playerinfo))
                    bets['t'][userid_from_playerinfo(playerinfo)] = int(amount)
                if team == "ct":
                    SayText2(message="PAYOUT - " + amount + " SAT - CT WIN").send(index_from_playerinfo(playerinfo))
                    leetcoin_client.requestAward(-int(amount), "PAYOUT - " + amount + " SAT - CT WIN", userid_from_playerinfo(playerinfo))
                    bets['ct'][userid_from_playerinfo(playerinfo)] = int(amount)
            else:
                SayText2(message="Minimum bet is 100 SAT").send(index_from_playerinfo(playerinfo))
        else:
            SayText2(message="Only spectators can bet").send(index_from_playerinfo(playerinfo))
    else:
        SayText2(message="Type: bet <team> <amount>").send(index_from_playerinfo(playerinfo))
Ejemplo n.º 3
0
def client_command_ultimate(playerinfo, command):
    """Raises ultimate event with player's information."""

    Player_Ultimate(
        index=index_from_playerinfo(playerinfo),
        userid=userid_from_playerinfo(playerinfo)
    ).fire()
def saycommand_bounty(playerinfo, teamonly, command):
    # bounty <player> <amount>
    params = str(command[1]).split(" ")

    if len(params) == 3:
        playername = params[1]
        amount = int(params[2])

        if amount > 0:
            # Lookup player name
            humans = PlayerIter('human', return_types=['name', 'userid'])
            playerFound = False
            for name, userid in humans:
                if name == playername:
                    playerFound = True
                    target = userid

            if playerFound:
                leetcoin_client.requestAward(-int(amount), "BOUNTY", userid_from_playerinfo(playerinfo))
                if userid in bounties:
                    bounties[userid] += amount
                else:
                    bounties[userid] = amount
                SayText2(message="BOUNTY PLACED ON " + playername).send(index_from_playerinfo(playerinfo))
            else:
                SayText2(message="Player not found").send(index_from_playerinfo(playerinfo))
    else:
        SayText2(message="Type: bounty <player> <amount>").send(index_from_playerinfo(playerinfo))
    pass
def saycommand_bounty(playerinfo, teamonly, command):
    # bounty <player> <amount>
    params = str(command[1]).split(" ")

    if len(params) == 3:
        playername = params[1]
        amount = int(params[2])

        if amount > 0:
            # Lookup player name
            humans = PlayerIter('human', return_types=['name', 'userid'])
            playerFound = False
            for name, userid in humans:
                if name == playername:
                    playerFound = True
                    target = userid

            if playerFound:
                leetcoin_client.requestAward(-int(amount), "BOUNTY", userid_from_playerinfo(playerinfo))
                if userid in bounties:
                    bounties[userid] += amount
                else:
                    bounties[userid] = amount
                SayText2(message="BOUNTY PLACED ON " + playername).send(index_from_playerinfo(playerinfo))
            else:
                SayText2(message="Player not found").send(index_from_playerinfo(playerinfo))
    else:
        SayText2(message="Type: bounty <player> <amount>").send(index_from_playerinfo(playerinfo))
    pass
Ejemplo n.º 6
0
def client_command_ultimate(playerinfo, command):
    """Raises ultimate event with player's information."""

    Player_Ultimate(index=index_from_playerinfo(playerinfo),
                    userid=userid_from_playerinfo(playerinfo)).fire()