24.05.2017, 03:33
(
Последний раз редактировалось FizzyWalshy; 29.06.2017 в 06:03.
)
Remove -Fixed.
CMD:dicebet(playerid, params[])
{
new targetid, amount;
if(PlayerInfo[playerid][pLevel] < 3) return SendClientMessage(playerid, COLOR_GREY, "You need to have 100+ score in order to dice bet.");
if(sscanf(params, "ui", targetid, amount)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "[Usage]: /dicebet [playerid] [amount]");
if(targetid == playerid) return SendClientMessage(playerid, COLOR_GREY, "You can't use this command on yourself.");
if(PlayerInfo[targetid][pLevel] < 3) return SendClientMessage(playerid, COLOR_GREY, "That player must be at least level 3+ to bet with them.");
if(amount < 1) return SendClientMessage(playerid, COLOR_GREY, "The amount can't be below $1.");
if(PlayerInfo[playerid][pCash] < amount) return SendClientMessage(playerid, COLOR_GREY, "You don't have that much money to bet.");
if(gettime() - PlayerInfo[playerid][pLastBet] < 10) return SendClientMessageFormatted(playerid, COLOR_GREY, "You can only use this command every 10 seconds. Please wait %i more seconds.", 10 - (gettime() - PlayerInfo[playerid][pLastBet]));
PlayerInfo[targetid][pDiceOffer] = playerid;
PlayerInfo[targetid][pDiceBet] = amount;
PlayerInfo[playerid][pLastBet] = gettime();
SendClientMessageFormatted(targetid, COLOR_AQUA, "** %s has initiated a dice bet with you for $%i (/accept dicebet).", GetPlayerNameEx(playerid), amount);
SendClientMessageFormatted(playerid, COLOR_AQUA, "** You have initiated a dice bet against %s for $%i.", GetPlayerNameEx(targetid), amount);
return 1;
}
Pretty sure that evel 3 isn't supposed to be there
Also, It is better to make the returns in line as it will reduce the number of lines and makes it easier to read the code. You don't have to worry about missing curly brackets either. PHP код:
|