2021-02-23, 02:09 AM
(This post was last modified: 2021-02-23, 02:28 PM by Hitler.)
Espa?ol: ya tengo una funci?n que muestra a los 5 mejores top score, pero como lo hago para hacerlo en un texto 2d?
English: I already have a function that shows the top 5 scores, but how do I do it in a 2d text?
Code: CMD:top(playerid)
{
mysql_pquery(con, "SELECT `Nombre`, `Score` FROM `usuarios` WHERE `Score` > 0 ORDER BY `Score` DESC LIMIT 5", "MejoresScore", "d", playerid);
return 1;
}
funcion MejoresScore(playerid)
{
new rows = cache_num_rows(),string[300],Escore,nameplayer[MAX_PLAYER_NAME];
if(rows > 0)
{
string = "{FFFFFF}Lista 5?mejores Scores\n\n";
for(new i=0; i<rows; i)
{
cache_get_value_name_int(i, "Score", Escore);
cache_get_value_name(i, "Nombre", nameplayer, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s#%d\t%s? %d Score\n",string,i,nameplayer,Escore);
}
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Top Scores", string, "Cerrar", "");
}
return 1;
}
como as?:? https://imgur.com/SO3F1Fj
what do you want to achieve, you didn't add english language.
(2021-02-23, 10:17 AM)destiezk Wrote: what do you want to achieve, you didn't add english language.
Fixed up,? I already have a function that shows the top 5 scores, but how do I do it in a 2d text?
(2021-02-23, 02:32 PM)Hitler Wrote: (2021-02-23, 10:17 AM)destiezk Wrote: what do you want to achieve, you didn't add english language.
Fixed up,?I already have a function that shows the top 5 scores, but how do I do it in a 2d text? https://open.mp/docs/scripting/functions...terialText
help
Code: new objectId = CreateObject(19353,2214.05127,-57.67043, 28.17278,0.00000,0.00000,89.51998); // team 1.40
new pruebaa[300];
format(pruebaa, sizeof(pruebaa), "SELECT * FROM `usuarios` ORDER BY `Score` DESC LIMIT 3");
new rows = cache_num_rows(),Escore,prueba[50],nameplayer[MAX_PLAYER_NAME];
if(rows > 0)
{
prueba = "{FFFFFF}Lista 3 mejores Scores\n\n";
for(new i=0; i<rows; i)
{
cache_get_value_name_int(i, "Score", Escore);
cache_get_value_name(i, "Nombre", nameplayer, MAX_PLAYER_NAME);
format(prueba, sizeof(prueba), "%s#%d\t%s? %d Score\n",prueba,i,nameplayer,Escore);
}
}
? ? SetObjectMaterialText(objectId, prueba, 0, OBJECT_MATERIAL_SIZE_256x128,"Arial", 28, 1, 0xFFFF8200, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
PHP Code: new objectId = CreateObject(19353, 2214.05127, -57.67043, 28.17278, 0.00000, 0.00000, 89.51998); // team 1.40
new pruebaa[300];
new Cache: result = mysql_query(MYSQL_DEFAULT_HANDLE, "SELECT * FROM `usuarios` ORDER BY `Score` DESC LIMIT 3");
new rows = cache_num_rows(), Escore, prueba[50], nameplayer[MAX_PLAYER_NAME];
if (rows)
{
prueba = "{FFFFFF}Lista 3 mejores Scores\n\n";
for (new i = 0; i < rows; i)
{
cache_get_value_name_int(i, "Score", Escore);
cache_get_value_name(i, "Nombre", nameplayer, MAX_PLAYER_NAME);
format(prueba, sizeof(prueba), "%s#%d\t%s? %d Score\n", prueba, i 1, nameplayer, Escore);
}
cache_delete(result);
}
SetObjectMaterialText(objectId, prueba, 0, OBJECT_MATERIAL_SIZE_256x128, "Arial", 28, 1, 0xFFFF8200, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
2021-02-24, 12:19 AM
(This post was last modified: 2021-02-24, 12:21 AM by Hitler.)
(2021-02-23, 10:23 PM)Radical Wrote: PHP Code: new objectId = CreateObject(19353, 2214.05127, -57.67043, 28.17278, 0.00000, 0.00000, 89.51998); // team 1.40 new pruebaa[300];
new Cache: result = mysql_query(MYSQL_DEFAULT_HANDLE, "SELECT * FROM `usuarios` ORDER BY `Score` DESC LIMIT 3");
new rows = cache_num_rows(), Escore, prueba[50], nameplayer[MAX_PLAYER_NAME];
if (rows)
{
prueba = "{FFFFFF}Lista 3 mejores Scores\n\n";
for (new i = 0; i < rows; i)
{
cache_get_value_name_int(i, "Score", Escore);
cache_get_value_name(i, "Nombre", nameplayer, MAX_PLAYER_NAME);
format(prueba, sizeof(prueba), "%s#%d\t%s %d Score\n", prueba, i 1, nameplayer, Escore);
} cache_delete(result);
} SetObjectMaterialText(objectId, prueba, 0, OBJECT_MATERIAL_SIZE_256x128, "Arial", 28, 1, 0xFFFF8200, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
Gracias
|