Title in Middle - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Title in Middle (
/showthread.php?tid=354010)
Title in Middle -
kbalor - 25.06.2012
Is there any possibility to move the title in middle like this.
Код:
format(string, sizeof(string), "\t{008A2E}%s's {CCCCCC}Statistics",PlayerName2(player1));
Re: Title in Middle -
Jonny5 - 25.06.2012
im sorry what title?
Re: Title in Middle -
kbalor - 25.06.2012
Quote:
Originally Posted by Jonny5
im sorry what title?
|
Here
Код:
dcmd_stats(playerid,params[])
{
new string[256];
new pDeaths;
new player1, h, m, s;
if(!strlen(params)) player1 = playerid;
else player1 = strval(params);
if(IsPlayerConnected(player1))
{
TotalGameTime(player1, h, m, s);
if(AccInfo[player1][Deaths] == 0) pDeaths = 1;
else pDeaths = AccInfo[player1][Deaths];
format(string, sizeof(string), "\t{008A2E}%s's {CCCCCC}Statistics",PlayerName2(player1));
new statstring[256];
format(statstring, sizeof(statstring), "{99CCFF}Admin Level: %d \n\nScore: %d \n\nKills: %d \n\nDeaths: %d \n\nRatio: %0.2f \n\nMoney: $%d \n\nTime: %d Hours %d Minutes and %d Seconds ", AccInfo[player1][Level], GetPlayerScore(playerid), AccInfo[player1][Kills], AccInfo[player1][Deaths], Float:AccInfo[player1][Kills]/Float:pDeaths, GetPlayerMoney(player1), h, m, s);
ShowPlayerDialog(playerid,12767,DIALOG_STYLE_MSGBOX,string,statstring ,"Close","");
return 0;
} else
return SendClientMessage(playerid, red, "ERROR: Player Not Connected!");
}
/t Let Lists In The Middle Or Let's say it is a TAB
When i add \t nothing happen. it dont move.
Re: Title in Middle -
Grand_Micha - 25.06.2012
pawn Код:
format(string, sizeof(string), "___________{008A2E}%s's {CCCCCC}Statistics___________",PlayerName2(player1));
Ingenious!
Re: Title in Middle -
Lordzy - 25.06.2012
You mean random messages on screen?
Re: Title in Middle -
Jonny5 - 25.06.2012
Quote:
Originally Posted by Grand_Micha
pawn Код:
format(string, sizeof(string), "___________{008A2E}%s's {CCCCCC}Statistics___________",PlayerName2(player1));
Ingenious!
|
thats one way
the other is with the format
this page "for printf" but will work for format
explains the different ways to pad a formatted string
http://www.codingunit.com/printf-for...rmatted-output
know the dialog title can only be 64 will help.