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,14 +528,20 @@ static stock forfeitPlayerDuel(playerid)
|
|||||||
|
|
||||||
SpawnPlayer(winnerid);
|
SpawnPlayer(winnerid);
|
||||||
ClearDuelInvites(winnerid);
|
ClearDuelInvites(winnerid);
|
||||||
p_playerDueling{playerid} = false;
|
|
||||||
|
|
||||||
if (0 < amount_waged < 10000000) {
|
// decrement rounds
|
||||||
new winning_prize = floatround(float(amount_waged) * 1.9); // We take 5% of the total pot
|
duelInfo[playerid][duelRemainingRounds] --;
|
||||||
GivePlayerCash(winnerid, winning_prize);
|
duelInfo[winnerid][duelRemainingRounds] = duelInfo[playerid][duelRemainingRounds];
|
||||||
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 {
|
// check if theres a remaining round
|
||||||
SendClientMessageToAllFormatted( -1, ""COL_DUEL"[DUEL]{FFFFFF} %s(%d) has won the duel against %s(%d)!", ReturnPlayerName(winnerid), winnerid, ReturnPlayerName(playerid), playerid);
|
if (duelInfo[playerid][duelRemainingRounds] == 0) {
|
||||||
|
if (0 < amount_waged < 10000000) {
|
||||||
|
new winning_prize = floatround(float(amount_waged) * 1.95); // We take 2.5% of the total pot
|
||||||
|
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));
|
||||||
|
} else {
|
||||||
|
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