Can anyone please convert this to zcmd
Code:
if(!strcmp(params, "/bet", true)) == 0)
{
new
offeredby = PlayerInfo[playerid][pDiceOffer],
amount = PlayerInfo[playerid][pDiceBet];
if(offeredby == INVALID_PLAYER_ID)
{
return SendClientMessage(playerid, COLOR_GREY, "You haven't received any offers for dice betting.");
}
if(!IsPlayerInRangeOfPlayer(playerid, offeredby, 5.0))
{
return SendClientMessage(playerid, COLOR_GREY, "The player who initiated the offer is out of range.");
}
if(PlayerInfo[playerid][pCash] < amount)
{
return SendClientMessage(playerid, COLOR_GREY, "You can't afford to accept this bet.");
}
if(PlayerInfo[offeredby][pCash] < amount)
{
return SendClientMessage(playerid, COLOR_GREY, "That player can't afford to accept this bet.");
}
new
rand[2];
rand[0] = random(6) + 1;
rand[1] = random(6) + 1;
SendClientMessageFormatted(offeredby, 20.0, COLOR_WHITE, "** %s rolls a dice which lands on the number %i.", GetPlayerNameEx(offeredby), rand[0]);
SendClientMessageFormatted(playerid, 20.0, COLOR_WHITE, "** %s rolls a dice which lands on the number %i.", GetPlayerNameEx(playerid), rand[1]);
if(rand[0] > rand[1])
{
GivePlayerCash(offeredby, amount);
GivePlayerCash(playerid, -amount);
SendClientMessageFormatted(offeredby, COLOR_AQUA, "** You have won $%i from your dice bet with %s.", amount, GetPlayerNameEx(playerid));
SendClientMessageFormatted(playerid, COLOR_RED, "** You have lost $%i from your dice bet with %s.", amount, GetPlayerNameEx(offeredby));
if(amount > 10000 && !strcmp(GetPlayerIP(offeredby), GetPlayerIP(playerid)))
{
SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s (IP: %s) won a $%i dice bet against %s (IP: %s).", GetPlayerNameEx(offeredby), GetPlayerIP(offeredby), amount, GetPlayerNameEx(playerid), GetPlayerIP(playerid));
}
}
else if(rand[0] == rand[1])
{
SendClientMessageFormatted(offeredby, COLOR_AQUA, "** The bet of $%i was a tie. You kept your money as a result!", amount);
SendClientMessageFormatted(playerid, COLOR_AQUA, "** The bet of $%i was a tie. You kept your money as a result!", amount);
}
else
{
GivePlayerCash(offeredby, -amount);
GivePlayerCash(playerid, amount);
SendClientMessageFormatted(playerid, COLOR_AQUA, "** You have won $%i from your dice bet with %s.", amount, GetPlayerNameEx(offeredby));
SendClientMessageFormatted(offeredby, COLOR_RED, "** You have lost $%i from your dice bet with %s.", amount, GetPlayerNameEx(playerid));
if(amount > 10000 && !strcmp(GetPlayerIP(offeredby), GetPlayerIP(playerid)))
{
SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s (IP: %s) won a $%i dice bet against %s (IP: %s).", GetPlayerNameEx(playerid), GetPlayerIP(playerid), amount, GetPlayerNameEx(offeredby), GetPlayerIP(offeredby));
}
}
PlayerInfo[playerid][pDiceOffer] = INVALID_PLAYER_ID;
}*/