#1

After winning in duel it add + 1, but after winning again in duel it doesn't add +1. It remain +1, but you can see I already have
Код:
PlayerInfo[killerid][Duels]++;
this is under onplayerdeath

pawn Код:
if(GetPVarInt(killerid, "InDuel") == 1 && GetPVarInt(playerid, "InDuel") == 1)
    {
        PlayerInfo[killerid][Duels]++;
       
        new gBet = GetPVarInt(playerid, "DuelBet");
        new gDuelSpot = GetPVarInt(playerid, "DuelSpot");

        new Slot[3];
        Slot[0] = GetPVarInt(killerid, "dWeap1");
        Slot[1] = GetPVarInt(killerid, "dWeap2");
        Slot[2] = GetPVarInt(killerid, "dWeap3");

        Money_GivePlayerMoney(playerid, -gBet);
        Money_GivePlayerMoney(killerid, gBet);


        new str[230], duelid[40];
        new HPT = GetRoundedTotalHP(playerid);
        format(duelid, sizeof(duelid), "%s", ReturnDuelNameFromID(gDuelSpot));
        format(str, sizeof(str), "Duel: %s won the duel against %s (HP %d) (%s %s %s) (Bet: $%d) (%s (ID: %d))", pName(killerid), pName(playerid), HPT, weaponNames(Slot[0]), weaponNames(Slot[1]), weaponNames(Slot[2]), gBet, duelid, gDuelSpot);
        SendClientMessageToAll(0xFF1493FF, str);
       
        SetPlayerArmour(playerid, 0);
        SetPlayerArmour(killerid, 0);

        RemoveFromDuel(playerid);
        RemoveFromDuel(killerid);
        SpawnPlayer(killerid);
    }
    else if(killerid == INVALID_PLAYER_ID && GetPVarInt(playerid, "InDuel") == 1)
    {
        new gBet = GetPVarInt(playerid, "DuelBet");
        new gDuelSpot = GetPVarInt(playerid, "DuelSpot");

        new Slot[3];
        Slot[0] = GetPVarInt(playerid, "dWeap1");
        Slot[1] = GetPVarInt(playerid, "dWeap2");
        Slot[2] = GetPVarInt(playerid, "dWeap3");

        Money_GivePlayerMoney(playerid, -gBet);
        Money_GivePlayerMoney(killerid, gBet);

        new str[220];
        format(str, sizeof(str), "Duel: %s commited suicide during a duel with %s (%s %s %s) (Bet: $%d) (%s (ID: %d))", pName(playerid), pName(GetPVarInt(playerid, "InviterID")), weaponNames(Slot[0]), weaponNames(Slot[1]), weaponNames(Slot[2]), gBet, ReturnDuelNameFromID(gDuelSpot), gDuelSpot);
        SendClientMessageToAll(GREY, str);

        new duelerid = GetPVarInt(playerid, "InviterID");

        SetPlayerArmour(playerid, 0);
        SetPlayerArmour(duelerid, 0);
        RemoveFromDuel(duelerid);
        RemoveFromDuel(playerid);
        SpawnPlayer(duelerid);
    }
    return 1;
}
Reply
#2

Explain more please..
Reply
#3

Quote:
Originally Posted by James_Nick
Посмотреть сообщение
Explain more please..
I created my own duel saving system. But I think it was my bad.

First I made this...

Код:
dini_IntSet(file, "Duels", PlayerInfo[playerid][Score]);
but that is wrong and I've changed it to...

pawn Код:
dini_IntSet(file, "Duels", PlayerInfo[playerid][Duels]);
I haven't tried it. But I guess this should do fine now.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)