pawn Код:
CMD:diceroll(playerid, params[])
{
new iTarget = pDiceBetID[playerid];
new iTargetDice = iTarget;
if(pDiceBetID[playerid] == iTarget && pDiceBetID[iTarget] == playerid && pDiceBetAmount[playerid] == pDiceBetAmount[iTarget])
{
new szString[128],
//szString2[128],
szPlayerName[MAX_PLAYER_NAME],
iMoney;
new dice = random(6)+1;
GetPlayerName(playerid, szPlayerName, sizeof(szPlayerName));
format(szString, sizeof(szString), "* %s rolls a dice that lands on %d.",szPlayerName,dice);
SendClientMessage(playerid, -1, szString);
SendClientMessage(iTargetDice, -1, szString);
Highest[playerid] = dice;
if(Highest[playerid] > Highest[iTargetDice])
{
format(szString, sizeof(szString), "You have lost $%i to %s this was taken from you.", pDiceBetAmount[iTargetDice], szPlayerName);
SendClientMessage(iTargetDice, -1, szString);
format(szString, sizeof(szString), "You have won $%i from %s you have been given this.",pDiceBetAmount[playerid],iTargetDice);
SendClientMessage(playerid, -1, szString);
GivePlayerMoney(iTargetDice, -pDiceBetAmount[iTargetDice]);
GivePlayerMoney(playerid, pDiceBetAmount[playerid]);
}
else if(Highest[iTargetDice] > Highest[playerid])
{
format(szString, sizeof(szString), "You have lost $%i to %s this was taken from you.", pDiceBetAmount[playerid], iTargetDice);
SendClientMessage(playerid, -1, szString);
format(szString, sizeof(szString), "You have won $%i from %s you have been given this.",pDiceBetAmount[iTargetDice], szPlayerName);
SendClientMessage(iTargetDice, -1, szString);
GivePlayerMoney(iTargetDice, pDiceBetAmount[iTargetDice]);
GivePlayerMoney(playerid, -pDiceBetAmount[playerid]);
}
}
else return SendClientMessage(playerid, -1, "No one has offered you a dicebet!");
return 1;
}
Thats the code