Noticias:

Debes de estar registrado para poder ver el contenido indicado. Registrate o Conectate

Menú Principal

Set PVP Rewards - getPvpKills

Iniciado por Swarlog, Ago 12, 2022, 01:31 AM

Tema anterior - Siguiente tema

Swarlog

st.getPlayer().getPvpKills()  # gets players PVP count
st.getPlayer().setPvpKills(st.getPlayer().getPvpKills() - 1) # decreases players PVP count by 1

def managePVP(action,amount):
    if action=="inc":
        st.getPlayer().setPvpKills(st.getPlayer().getPvpKills() + amount)

    # we can't check if player has 0 PVP points, because server will give fatal error
    # so we are checking players PVP point count after doing the subtraction
    if action=="dec":
        if st.getPlayer().getPvpKills - amount <= 0:
            return "You don't have enough PVP points"
        else:
            st.getPlayer().setPvpKills(st.getPlayer().getPvpKills() - amount)

managePVP("dec",1)
Otros codes relacionados:

// Add karma to attacker and increase its PK counter
setPvpKills(getPvpKills() + 1);

activeChar.updatePvPFlag(1);
activeChar.stopPvPFlag();