How to edit textdraw keeping previous input whilst updating present output -
SlayerHodge - 17.07.2018
Problem: I have tried this textdraw but keep failing at it. I am trying to update the textdraw keeping information that was inputted by other players. ((this sounds mad confusing, it's a show and tell))
What I want to happen SS:
Code:
Код:
//global variable
new Text:Dealertext1,Text:Dealertexton1,Text:Dealertext2,Text:Dealertexon2,Text:Dealerplayer;
OnGamemodeInIt()
{
Init__Textdraw();
return 1;
}
stock Init__Textdraw()
{
//Dealer textdraw
PlayerLoop(i)
{
Dealertext1 = TextDrawCreate(455.000000, 176.000000, "BETS:");
TextDrawBackgroundColor(Dealertext1, 255);
TextDrawFont(Dealertext1, 2);
TextDrawLetterSize(Dealertext1, 0.419999, 1.099999);
TextDrawColor(Dealertext1, -1);
TextDrawSetOutline(Dealertext1, 0);
TextDrawSetProportional(Dealertext1, 1);
TextDrawSetShadow(Dealertext1, 1);
TextDrawUseBox(Dealertext1, 1);
TextDrawBoxColor(Dealertext1, 255);
TextDrawTextSize(Dealertext1, 627.000000, 10.000000);
Dealertexton1 = TextDrawCreate(545.000000, 176.000000, "OFF");
TextDrawBackgroundColor(Dealertexton1, 255);
TextDrawFont(Dealertexton1, 2);
TextDrawLetterSize(Dealertexton1, 0.419900, 1.099900);
TextDrawColor(Dealertexton1, -16776961);
TextDrawSetOutline(Dealertexton1, 0);
TextDrawSetProportional(Dealertexton1, 1);
TextDrawSetShadow(Dealertexton1, 1);
Dealertext2 = TextDrawCreate(455.000000, 190.000000, "NUMBERS:");
TextDrawBackgroundColor(Dealertext2, 255);
TextDrawFont(Dealertext2, 2);
TextDrawLetterSize(Dealertext2, 0.419900, 1.099900);
TextDrawColor(Dealertext2, -1);
TextDrawSetOutline(Dealertext2, 0);
TextDrawSetProportional(Dealertext2, 1);
TextDrawSetShadow(Dealertext2, 1);
TextDrawUseBox(Dealertext2, 1);
TextDrawBoxColor(Dealertext2, 255);
TextDrawTextSize(Dealertext2, 627.000000, 0.000000);
Dealertexon2 = TextDrawCreate(545.000000, 190.000000, "OFF");
TextDrawBackgroundColor(Dealertexon2, 255);
TextDrawFont(Dealertexon2, 2);
TextDrawLetterSize(Dealertexon2, 0.419900, 1.099900);
TextDrawColor(Dealertexon2, -16776961);
TextDrawSetOutline(Dealertexon2, 0);
TextDrawSetProportional(Dealertexon2, 1);
TextDrawSetShadow(Dealertexon2, 1);
Dealerplayer = TextDrawCreate(455.000000, 204.000000, " ");
TextDrawBackgroundColor(Dealerplayer, 255);
TextDrawFont(Dealerplayer, 2);
TextDrawLetterSize(Dealerplayer, 0.170000, 1.000000);
TextDrawColor(Dealerplayer, -1);
TextDrawSetOutline(Dealerplayer, 0);
TextDrawSetProportional(Dealerplayer, 1);
TextDrawSetShadow(Dealerplayer, 1);
TextDrawUseBox(Dealerplayer, 1);
TextDrawBoxColor(Dealerplayer, 255);
TextDrawTextSize(Dealerplayer, 627.000000, 0.000000);
}
//end of dealer textdraw
}
ISSUE is HERE:
Код:
COMMAND:bet(playerid, params[])
{
new amount, bet[128], message[128], TextdrawMSG[1280], str[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);
/*here*/format(TextdrawMSG, sizeof(str), "|%d|%s bet:%s AMOUNT: %d~n~", playerid, PlayerName(playerid), bet,
strcat(TextdrawMSG, str, sizeof(TextdrawMSG));
SendTableMSG(playerid, message);
TextDrawSetString(Dealerplayer,TextdrawMSG);
CasinoTextDraw(playerid);
PlayerTemp[playerid][betted] = 1;
return 1;
}
What i notice happening is instead of continuing on a new line everytime a player does this command it replaces the text that was there instead. Thanks in advance
Re: How to edit textdraw keeping previous input whilst updating present output -
SlayerHodge - 17.07.2018
Another issue that i find is happening is that I am currently getting the textdraw blinking, and i cant figure out why.