duel bug fixed
This commit is contained in:
parent
1e4a40c09b
commit
df4c33680e
@ -35,6 +35,7 @@ enum duelData
|
|||||||
duelCountdown,
|
duelCountdown,
|
||||||
duelTimer,
|
duelTimer,
|
||||||
duelLocation,
|
duelLocation,
|
||||||
|
duelRemainingRounds
|
||||||
};
|
};
|
||||||
|
|
||||||
enum locationData
|
enum locationData
|
||||||
@ -411,6 +412,8 @@ CMD:duel(playerid, params[])
|
|||||||
duelInfo[targetid][duelPlayer] = playerid;
|
duelInfo[targetid][duelPlayer] = playerid;
|
||||||
duelInfo[playerid][duelPlayer] = targetid;
|
duelInfo[playerid][duelPlayer] = targetid;
|
||||||
duelInfo[playerid][duelBet] = duelInfo[targetid][duelBet];
|
duelInfo[playerid][duelBet] = duelInfo[targetid][duelBet];
|
||||||
|
duelInfo[playerid][duelRemainingRounds] = 1;
|
||||||
|
duelInfo[targetid][duelRemainingRounds] = 1;
|
||||||
|
|
||||||
new id = duelInfo[targetid][duelLocation];
|
new id = duelInfo[targetid][duelLocation];
|
||||||
|
|
||||||
@ -525,15 +528,21 @@ static stock forfeitPlayerDuel(playerid)
|
|||||||
|
|
||||||
SpawnPlayer(winnerid);
|
SpawnPlayer(winnerid);
|
||||||
ClearDuelInvites(winnerid);
|
ClearDuelInvites(winnerid);
|
||||||
p_playerDueling{playerid} = false;
|
|
||||||
|
|
||||||
|
// decrement rounds
|
||||||
|
duelInfo[playerid][duelRemainingRounds] --;
|
||||||
|
duelInfo[winnerid][duelRemainingRounds] = duelInfo[playerid][duelRemainingRounds];
|
||||||
|
|
||||||
|
// check if theres a remaining round
|
||||||
|
if (duelInfo[playerid][duelRemainingRounds] == 0) {
|
||||||
if (0 < amount_waged < 10000000) {
|
if (0 < amount_waged < 10000000) {
|
||||||
new winning_prize = floatround(float(amount_waged) * 1.9); // We take 5% of the total pot
|
new winning_prize = floatround(float(amount_waged) * 1.95); // We take 2.5% of the total pot
|
||||||
GivePlayerCash(winnerid, winning_prize);
|
GivePlayerCash(winnerid, winning_prize);
|
||||||
SendClientMessageToAllFormatted( -1, ""COL_DUEL"[DUEL]{FFFFFF} %s(%d) has won the duel against %s(%d) for %s!", ReturnPlayerName(winnerid), winnerid, ReturnPlayerName(playerid), playerid, number_format(winning_prize));
|
SendClientMessageToAllFormatted( -1, ""COL_DUEL"[DUEL]{FFFFFF} %s(%d) has won the duel against %s(%d) for %s!", ReturnPlayerName(winnerid), winnerid, ReturnPlayerName(playerid), playerid, number_format(winning_prize));
|
||||||
} else {
|
} else {
|
||||||
SendClientMessageToAllFormatted( -1, ""COL_DUEL"[DUEL]{FFFFFF} %s(%d) has won the duel against %s(%d)!", ReturnPlayerName(winnerid), winnerid, ReturnPlayerName(playerid), playerid);
|
SendClientMessageToAllFormatted( -1, ""COL_DUEL"[DUEL]{FFFFFF} %s(%d) has won the duel against %s(%d)!", ReturnPlayerName(winnerid), winnerid, ReturnPlayerName(playerid), playerid);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user