When you /dicebet them, it said (/dicebet [id] [ammount]) and if he accept it and it will automatically roll the dice and someone will win with dicebet price
and the guys who win like bet 1m and then guy who win 2m and guy who lose lose 1m simple, and max dice 36m
This is Scripting Help section not for Requesting, do some effort and we can help you if you got errors
can u just do it for me pls i cant script i am wroth less i treid thousands of times
Post in looking for scripters/helpers topic. Follow the rules.
PHP код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>
new Bet[MAX_PLAYERS], Invited[MAX_PLAYERS], Dicetimer[MAX_PLAYERS], Guess[MAX_PLAYERS];
forward CancelBet(playerid);
public CancelBet(playerid)
{
Bet[playerid] = 0;
Invited[playerid] = 0;
Guess[playerid] = 0;
SendClientMessage(playerid, -1, "Dice bet invitation canceled. [15 Seconds passed]");
}
CMD:diceinvite(playerid, params[])
{
new id, bet, guess, name[25], string[100];
GetPlayerName(playerid, name, 25);
if(sscanf(params, "ui", id, bet, guess)) return SendClientMessage(playerid, -1, "{0008F7}USAGE: {FFFFFF}/DICEBET ID BET YOUR_GUESS[1-6]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Player is not connected");
if(GetPlayerMoney(playerid) < bet) return SendClientMessage(playerid, -1, "You cannot affrod this ammount");
if(GetPlayerMoney(id) < bet) return SendClientMessage(playerid, -1, "Player cannot affrod this ammount");
if(guess < 1 || guess > 6) return SendClientMessage(playerid, -1, "Invalid guess. [1-6]");
format(string, 100, "Dice Bet invitation from %s Price $%d. His guess %d. /DICEACCEPT YOUR_GUESS to accept it.", name, bet, guess);
SendClientMessage(id, -1, string);
SendClientMessage(playerid, -1, "Dice bet invitation Sent!");
Bet[playerid] = bet;
Bet[id] = bet;
Invited[playerid] = id;
Invited[id] = playerid;
Guess[playerid] = guess;
Dicetimer[playerid] = SetTimerEx("CancelBet", 15000, false, "i", playerid);
Dicetimer[id] = SetTimerEx("CancelBet", 15000, false, "i", id);
return 1;
}
CMD:diceaccept(playerid, params[])
{
new guess, name[25], iname[25], string[100];
GetPlayerName(playerid, name, 25);
if(sscanf(params, "i", guess)) return SendClientMessage(playerid, -1, "{0008F7}USAGE: {FFFFFF}/DICEACCEPT YOUR_GUESS[1-6]");
if(Invited[playerid] == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Player disconnected or your not invited to any Dicebet");
if(guess < 1 || guess > 6) return SendClientMessage(playerid, -1, "Invalid guess. [1-6]");
GetPlayerName(Invited[playerid], iname, 25);
KillTimer(Dicetimer[playerid]);
KillTimer(Dicetimer[Invited[playerid]]);
new rand = random(5);
if(rand == Guess[playerid]-1)
{
format(string, 100, "%s have won the Dicebet against %s and won %d", name, iname, Bet[playerid]);
SendClientMessageToAll(-1, string);
GivePlayerMoney(playerid, Bet[playerid]);
GivePlayerMoney(Invited[playerid], -Bet[playerid]);
}
else if(rand == Guess[Invited[playerid]]-1)
{
format(string, 100, "%s have won the Dicebet against %s and won %d", iname, name, Bet[playerid]);
SendClientMessageToAll(-1, string);
GivePlayerMoney(playerid, -Bet[playerid]);
GivePlayerMoney(Invited[playerid], Bet[playerid]);
}
else SendClientMessage(playerid, -1, "No one won!"), SendClientMessage(Invited[playerid], -1, "No one won!");
Bet[playerid] = 0;
Invited[playerid] = 0;
Guess[playerid] = 0;
Bet[Invited[playerid]] = 0;
Invited[Invited[playerid]] = 0;
Guess[Invited[playerid]] = 0;
return 1;
}
i added it to pawn complied it to amx file and put it into filter script renmed both to Dice and but in filter script and wrote that in server config too
the plugins ? i have scanff but add me on skype and help me linus.45 if u want to but if not u can help me from here