dealersystem Textdraw
#1

Issue: I am trying to make a textdraw related function, Basically, it's for a casino dealer's Roulette table. I wanted to gain the inputs of other Players when they used a command /bet on to every player who is connected to that dealer's table the exact textdraw. The problem i am facing at the moment, is that this function is only working with the dealers input of the command /bet, noother players input is being shown on the text draw.

I hope this is not confusing.


Код:
stock SendTableDealerUpdatedString(playerid, message[])
{
 new tableinfo[MAX_STRING];
 format(tableinfo, sizeof(tableinfo), "\n %s", message);
	PlayerLoop(i)
	{
		if(joinedtable[i] == true && tableid[i] == playerid)
		{
			if(IsPlayerConnected(playerid))
			{
				TextDrawSetString(Dealertxt, tableinfo);
                TextDrawShowForAll(Dealertxt);
			}
		}

	}
	return 1;
}
Reply
#2

command
Reply
#3

Show us the command maybe?
Reply
#4

Код:
COMMAND:openbets(playerid, params[])
{
	new imessage[128];
	if(PlayerInfo[playerid][dealer] != 1) return SendClientError(playerid, CANT_USE_CMD);
	if(PlayerTemp[playerid][dealerduty] != 1) return SendClientError(playerid, "You must be on dealer duty to use this command.");
	if(TableInfo[playerid][opened] == 0) return SendClientError(playerid, "You don't have any opened table.");
	TableInfo[playerid][bettingOpened] = 1;
	format(imessage, sizeof(imessage), "Betting is now - Opened -.", playerid, PlayerName(playerid));
	SendTableMSG(playerid, imessage);
	PlayerLoop(p)
	{
		if(tableid[p] == playerid && joinedtable[p])
		{
			TextDrawSetString(Dealertexton1, "~r~ Opened");
			TextDrawDestroy(Dealertext3);
            TextDrawShowForAll(Dealertext1);
		}
	}

	return 1;
}
COMMAND:closebets(playerid, params[])
{
	new imessage[128];
	if(PlayerInfo[playerid][dealer] != 1) return SendClientError(playerid, CANT_USE_CMD);
	if(PlayerTemp[playerid][dealerduty] != 1) return SendClientError(playerid, "You must be on dealer duty to use this command.");
	if(TableInfo[playerid][opened] == 0) return SendClientError(playerid, "You don't have any opened table.");
	TableInfo[playerid][bettingOpened] = 0;
	//NearMessage(playerid,"Closed betting",COLOR_ME2);
	//Action(playerid, "Closed betting");
	format(imessage, sizeof(imessage), "Betting is now - Closed -.", playerid, PlayerName(playerid));
	SendTableMSG(playerid, imessage);
	TextDrawSetString(Dealertxthead[playerid], "Bets: ~r~Closed");
	PlayerLoop(p)
	{
		if(tableid[p] == playerid && joinedtable[p]) 
		{
			TextDrawSetString(Dealertexton1, "~r~ CLOSED");
            TextDrawShowForAll(Dealertext1);
            TextDrawShowForAll(Dealertext2);
            TextDrawShowForAll(Dealertext3);
		}
	}
	return 1;
}

COMMAND:bet(playerid, params[])
{
	new amount, bet[128], message[128], TextdrawMSG[128];
	if(sscanf(params, "is", amount, bet))  return SCP(playerid, "[Amount] [Bet]");
	if(joinedtable[playerid] == false) return SendClientError(playerid, "You Haven't Joined a Dealer's Table!");
	if(PlayerTemp[playerid][sm] <= amount) return SendClientError(playerid, "You don't have this much cash in hand!");
	if(TableInfo[tableid[playerid]][bettingOpened] == 0) return SendClientError(playerid, "Bets are currently closed!");
	if(amount < TableInfo[tableid[playerid]][minbet] || amount > TableInfo[tableid[playerid]][maxbet]) return SendClientError(playerid, "Invalid amount! The amount is not within the Dealer's Betting Range!");
	if(PlayerTemp[playerid][betted] == 1) return SendClientError(playerid, "You have already betted!");
	GivePlayerMoneyEx(playerid,-amount);
	GivePlayerMoneyEx(tableid[playerid], amount);
	format(message, sizeof(message), "[%d] %s betted on ---> %s <--- [$%s]", playerid, PlayerName(playerid), bet, AddCommasToInt(amount));
	format(TextdrawMSG, sizeof(TextdrawMSG), "\\n[%d]%s bet:%s AMOUNT: %d", playerid, PlayerName(playerid), bet, AddCommasToInt(amount));
 	SendTableMSG(playerid, message);
	PlayerLoop(p)
	{
		if(tableid[p] == playerid && joinedtable[p])
		{
			TextDrawSetString(Dealertexton1, "~r~ CLOSED");
            TextDrawShowForAll(Dealertext1);
            TextDrawShowForAll(Dealertext2);
            TextDrawSetString(DealerText3, TextdrawMSG);
            TextDrawShowForAll(Dealertext3);
		}
	}

	PlayerTemp[playerid][betted] = 1;
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)