01.05.2018, 02:29
PHP код:
Dialog:stats(playerid, response, listitem, inputtext[])
{
if(response)
{
new id = g_SelectedOption[playerid];
if(!IsPlayerConnected(id) || !IsPlayer(id, loggedin))
return 1;
new gang = g_Player[id][gangid], fmt[1024], title[56], gangstr[56];
format(title, 56, "%p's statistics", id);
switch(listitem)
{
case 0:
{
if(gang == -1)
strcat(gangstr, "{FF0000}None");
else
format(gangstr, 56, "{%s}[%s]%s", g_Gang[gang][gcolour], g_Gang[gang][gtag], g_Gang[gang][gname]);
new modestr[28];
switch(g_Player[id][playermode])
{
case PMODE_NORMAL:
{
format(modestr, 28, "Normal");
}
case PMODE_PEACE:
{
format(modestr, 28, "Peace");
}
default:
{
format(modestr, 28, "None");
}
}
format(fmt, 1024, "{FFFFFF} \
"BLUE"General"WHITE"\n\
Account id \t%d\n \
Registered date \t%n\n \
Last logged in \t%n\n \
Kills \t\t%d\n \
Deaths \t%d\n \
K/D Ratio \t%.2f\n \
Money \t"GREEN"${FFFFFF}%m\n \
Coins \t\t%d\n \
Mode \t%s \n \
Playtime \t%d Hours %d Minutes %d Seconds\n \
Reaction test win \t%d \n \
Math quiz win \t%d \n \
Max Spree \t%d \n \
Gravity \t%f\n \
Skin \t\t%d\n \
Reaction Test Record \t%.2f Seconds\n \
Total Arrest \t%d\n \
"RED"Minigames"WHITE"\n\
Race Won \t\t%d \n \
Derby Won \t\t%d \n \
Parkour Completed \t%d \n \
Skydive Completed \t%d \n \
Vehicle Parkour Completed \t%d \n \
Moneybag Found \t%d \n \
"GREY"Jobs"WHITE"\n\
Bus Completed \t%d \n \
Pizza Completed \t%d \n \
Ojek Completed \t%d \n \
Taxi Completed \t%d \n \
Trashmaster Completed \t%d \n \
Truck Completed \t%d \n \
Sweeper Completed \t%d \n \
"PURPLE"Others"WHITE"\n\
Total Donasi \t$%m\n \
Packet Loss \t%.2f\n \
Gang \t\t%s", g_Player[id][dbid], g_Player[id][registered], g_Player[id][lastlogged], g_Player[id][kills], g_Player[id][deaths], ((g_Player[id][kills] * 1.0) / g_Player[id][deaths]), GetPlayerMoney(id), g_Player[id][coins], modestr, g_Player[id][logintime] / 3600, (g_Player[id][logintime] % 3600) / 60, g_Player[id][logintime] % 60, g_Player[id][reactiontest], g_Player[id][mathquiz], g_Player[id][maxspree], GetPlayerGravity(id), GetPlayerSkin(id), floatdiv(float(g_Player[id][reactiontestticks]), 1000), g_Player[id][arrest], g_Player[id][racewon], g_Player[id][derbywon], g_Player[id][parkourcomplete], g_Player[id][skydivecomplete], g_Player[id][vparkourcomplete], g_Player[id][moneybagfound], g_Player[id][buscompleted], g_Player[id][pizzacompleted], g_Player[id][ojekcompleted], g_Player[id][taxicompleted], g_Player[id][trashcompleted], g_Player[id][truckcompleted], g_Player[id][sweepercompleted], g_Player[id][totaldonation], NetStats_PacketLossPercent(id), gangstr);
Dialog_Show(playerid, "", DIALOG_STYLE_MSGBOX, title, fmt, CLOSE, "");
}
case 1:
{
new query[256], Cache:cache, count, rank, point, combo;
strcat(fmt, "Rank\tTrack Name\tPoint\tCombo\n");
foreach(new i : Drifts)
{
mysql_format(g_Sql, query, 256, "SELECT point, combo, 1 + (SELECT count(*) from drift_points a WHERE a.point > b.point AND driftid = %d) as rank FROM drift_points b WHERE playerid = %d AND driftid = %d ORDER BY rank ASC LIMIT 1", g_Drift[i][drid], g_Player[id][dbid], g_Drift[i][drid]);
cache = mysql_query(g_Sql, query, true);
cache_get_row_count(count);
if(count)
{
cache_get_value_index_int(0, 0, point);
cache_get_value_index_int(0, 1, combo);
cache_get_value_index_int(0, 2, rank);
format(fmt, 512, "%s#%d\t%s\t%d\t%d\n", fmt, rank, g_Drift[i][drname], point, combo);
}
else
format(fmt, 512, "%s-\t%s\t-\t-\n", fmt, g_Drift[i][drname]);
cache_delete(cache);
}
Dialog_Show(playerid, "", DIALOG_STYLE_TABLIST_HEADERS, title, fmt, CLOSE, "");
}
case 2:
{
new name[MAX_PLAYER_NAME];
GetPlayerName(id, name, MAX_PLAYER_NAME);
cmd_achievements(GetCommandID("achievements"), playerid, name);
}
}
}
return 1;
}
The text should be more left
EDIT:I found out that every msg dialog do the same with this,what could be the problem?
EDIT2:I found out that it's easyDialog.inc
I got this error now.
Код:
easyDialog.inc(63) : error 004: function "va_formatex" is not implemented
PHP код:
stock Dialog_Open(playerid, function[], style, caption[], info[], button1[], button2[], va_args<>)
{
static
string[4096]
;
if (!strlen(info))
{
return 0;
}
va_formatex(string, 4096, info, va_start<7>);
ShowPlayerDialog(playerid, 32700, style, caption, string, button1, button2);
s_DialogOpened[playerid] = 1;
strpack(s_DialogName[playerid], function, 32 char);
return 1;
}