22.01.2017, 00:41
(
Last edited by FizzyWalshy; 29/06/2017 at 06:06 AM.
)
Remove -Fixed.
CMD:dicebet(playerid, params[])
{
new string[128], giveplayerid, money;
if(sscanf(params, "ud", giveplayerid, money)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dicebet [playerid/partofname] [price]");
if(GetPVarInt(playerid, "GuardTimer") > 0)
{
format(string, sizeof(string), " You must wait %d seconds before again doing dice bet.", GetPVarInt(playerid, "GuardTimer"));
SendClientMessage(playerid,COLOR_GREY,string);
return 1;
}
if(money > PlayerInfo[playerid][pCash]) return SendClientMessage(playerid, COLOR_GREY, "You don't have that many cash!");
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(ProxDetectorS(8.0, playerid, giveplayerid))
{
SetPVarInt(playerid, "GuardTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GUARDTIMER);
format(string, sizeof(string), "* You offered %s a bet for $%d.", GetPlayerNameEx(giveplayerid), money);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s wants to gamble with you for $%d, type (/accept dicebet) to accept it.", GetPlayerNameEx(playerid), money);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
CoinOffer[giveplayerid] = playerid;
CoinPrice[giveplayerid] = money;
//format(string, sizeof(string), "* %s has offered the dice bet to %s for %d.",GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), money);
//ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "That player isn't near you.");
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Invalid player specified.");
}
return 1;
}
new CoinOffer[MAX_PLAYERS];