Jump to content
  • 0

Cerere Ajutor LuxAdmin /stats


xt3z0ne

Question

Nick:Johnny

Problema:Deci vre-au sa fac si eu /stats pe stock ShowStats  pentru ca e mult mai usor de editat si adugat.

Erori / warnings:~

Lini/script:

dmcd_stats Original.

[pawn]

dcmd_stats(playerid,params[])

{

new string[128];

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), "|- %s's Statistics -|",PlayerName2(player1));

SendClientMessage(playerid, green, string);

format(string, sizeof(string), "Kills: [%d] | Deaths: [%d] | Ratio: [%0.2f] | Money: [$%d] | Time: [%d] hrs [%d] mins [%d] secs | Admin:%d", AccInfo[player1][Kills], AccInfo[player1][Deaths], Float:AccInfo[player1][Kills]/Float:pDeaths,GetPlayerMoney(player1), h, m, s, AccInfo[playerid][Level]);

    return ShowPlayerDialog(playerid, 758, DIALOG_STYLE_MSGBOX, "Player Stats", string, "Ok", "");

} else

return SendClientMessage(playerid, red, "ERROR: Player Not Connected!");

}

[/pawn]

Ai incercat sa rezolvi singur ?:Dar nam reusit sa mai fac...

Eu am facut asa.

[pawn]

dcmd_stats(playerid, params[])

{

if(!sscanf(params, "u", givepid))

{

    if(IsPlayerConnected(givepid))

    {

    ShowPlayerDialog(playerid, 123, DIALOG_STYLE_MSGBOX, "{CCCCCC}Player Stats", ShowStats(givepid), "Ok");

return 1;

}

    else return SendClientMessage(playerid, red, "ERROR: Player not connected!");

}

else return ShowPlayerDialog(playerid, 9990, DIALOG_STYLE_MSGBOX, "{CCCCCC}Player Stats", ShowStats(playerid), "Ok");

}

[/pawn]

Si Stock

[pawn]

stock ShowStats(playerid)

{

    new h, m, s, SString[6][712], SStringF[3024];

//--------------------------------------------------------------------------

TotalGameTime(playerid, h, m, s);

//--------------------------------------------------------------------------

format(SString[5], 712, "{ffe100}Online Time: {ffffff}%d{1DEE01} hrs, {ffffff}%d{1DEE01} mins, {ffffff}%d{1DEE01} secs\n",h,m,s);

//--------------------------------------------------------------------------

format(SString[0], 712, "{FF0101}%s {1DEE01}'s {1DEE01}Statistics\n\n\

{FF6600}General Statistics\n\

{ffe100}Money: {ffffff}$%d\n\

{ffe100}Score: {ffffff}%d\n\

{ffe100}Coins: {ffffff}%d\n\

{ffe100}Respect: {ffffff}+%d{1DEE01} / {ffffff}-%d\n\

%s\

{ffe100}Admin Level: {ffffff}%d %s\n\

{ffe100}VIP Level: {ffffff}%d %s\n",

PlayerName2(playerid));

//--------------------------------------------------------------------------

return SStringF;

}

[/pawn]

Si imi da erorile astea.

[pawn]

D:\Games\DD SI DM\filterscripts\LuxAdmin.pwn(1494) : error 017: undefined symbol "givepid"

D:\Games\DD SI DM\filterscripts\LuxAdmin.pwn(1496) : error 017: undefined symbol "givepid"

D:\Games\DD SI DM\filterscripts\LuxAdmin.pwn(1498) : error 017: undefined symbol "givepid"

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

3 Errors.

[/pawn]

Sunt un retardat

Link to comment
Share on other sites

21 answers to this question

Recommended Posts

[pawn]dcmd_stats(playerid, params[])

{

        new givepid;

      //------------------------------------------------------------------------------

if(!sscanf(params, "u", givepid))

{

    if(IsPlayerConnected(givepid))

    {

    ShowPlayerDialog(playerid, 123, DIALOG_STYLE_MSGBOX, "{CCCCCC}Player Stats", ShowStats(givepid), "Ok");

return 1;

}

    else return SendClientMessage(playerid, red, "ERROR: Player not connected!");

}

else return ShowPlayerDialog(playerid, 9990, DIALOG_STYLE_MSGBOX, "{CCCCCC}Player Stats", ShowStats(playerid), "Ok");

}[/pawn]

Link to comment
Share on other sites

[pawn]dcmd_stats(playerid, params[])

{

        new givepid;

      //------------------------------------------------------------------------------

if(!sscanf(params, "u", givepid))

{

    if(IsPlayerConnected(givepid))

    {

    ShowPlayerDialog(playerid, 123, DIALOG_STYLE_MSGBOX, "{CCCCCC}Player Stats", ShowStats(givepid), "Ok");

return 1;

}

    else return SendClientMessage(playerid, red, "ERROR: Player not connected!");

}

else return ShowPlayerDialog(playerid, 9990, DIALOG_STYLE_MSGBOX, "{CCCCCC}Player Stats", ShowStats(playerid), "Ok");

}[/pawn]

Am facut cum mi-ati spus dar imi da 2 warnings.

[pawn]

D:\Games\DD SI DM\filterscripts\jAdmin.pwn(1496) : warning 217: loose indentation

D:\Games\DD SI DM\filterscripts\jAdmin.pwn(1500) : warning 202: number of arguments does not match definition

D:\Games\DD SI DM\filterscripts\jAdmin.pwn(1505) : warning 202: number of arguments does not match definition

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

3 Warnings.

[/pawn]

EDIT: Cand dau /stats pe server spune ca comanda nu este :|

Sunt un retardat

Link to comment
Share on other sites

Spune-mi ce ai la acele 3 linii

Linia: 1496

[pawn]

if(!sscanf(params, "u", givepid))

[/pawn]

Linia: 1500

[pawn]

ShowPlayerDialog(playerid, 123, DIALOG_STYLE_MSGBOX, "{CCCCCC}Player Stats", ShowStats(givepid), "Ok");

[/pawn]

Linia : 1505

[pawn]

else return ShowPlayerDialog(playerid, 9990, DIALOG_STYLE_MSGBOX, "{CCCCCC}Player Stats", ShowStats(playerid), "Ok");

[/pawn]

Sunt un retardat

Link to comment
Share on other sites

Da. Adauga "" la cele doua.

Rezolvat 2 warnigs.

A mai ramas asta.

[pawn]

D:\Games\DD SI DM\filterscripts\jAdmin.pwn(1496) : warning 217: loose indentation

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

1 Warning.

[/pawn]

 if(!sscanf(params, "u", givepid)) 

EDIT: Dau /stats si nu apare nimic:|

Sunt un retardat

Link to comment
Share on other sites

stock ShowStats(playerid)
{
new stats[200];

format(stats,200,"PlayerName: %s\n\
Money: %d\n\
Score: %d\n\",
PlayerName(playerid),GetPlayerMonet(playerid),GetPlayerScore(playerid));

ShowPlayerDialog(playerid,123,DIALOG_STYLE_MSGBOX,"Player Stats",stats,"Ok","");
return 1;
}

etc...si continui tu te descurci

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Link to comment
Share on other sites

stock ShowStats(playerid)
{
new stats[200];

format(stats,200,"PlayerName: %s\n\
Money: %d\n\
Score: %d\n\",
PlayerName(playerid),GetPlayerMonet(playerid),GetPlayerScore(playerid));

ShowPlayerDialog(playerid,123,DIALOG_STYLE_MSGBOX,"Player Stats",stats,"Ok","");
return 1;
}

etc...si continui tu te descurci

Am facut alt ceva :D

[pawn]dcmd_stats(playerid,params[])

{

    new str[512], pDeaths, player1, h, m, s;

    new tmp3[50];

    GetPlayerIp(player1,tmp3,50);

    if(!strlen(params)) player1 = playerid;

    else player1 = strval(params);

    if(!IsPlayerConnected(player1)) return SendClientMessage(playerid, red, "ERROR: Player Not Connected!");

    TotalGameTime(player1, h, m, s);

    if(AccInfo[player1][Deaths] == 0) pDeaths = 1;

    else pDeaths = AccInfo[player1][Deaths];

    format(str, sizeof(str), "{DAA520}%s (ID: %d){B0C4DE}\n", PlayerName2(player1), player1);

    format(str, sizeof(str), "%s{FF6600}General Statistics\n", str);

format(str, sizeof(str), "%s{ffe100}Money: {ffffff}$%d\n", str, GetPlayerMoney(player1));

    format(str, sizeof(str), "%s{ffe100}Score: {ffffff}%d\n", str, GetPlayerScore(player1));

    format(str, sizeof(str), "%s{ffe100}Online Time: {ffffff}%d{1DEE01} hrs, {ffffff}%d{1DEE01} mins, {ffffff}%d{1DEE01} secs\n", str, h, m, s);

    format(str, sizeof(str), "%s{ffe100}Biscuiti: {ffffff}%d\n", str, pInfo[playerid][Coins]);

    format(str, sizeof(str), "%s{FF6600}Level Statistics\n", str);

    format(str, sizeof(str), "%s{ffe100}Admin Level: {ffffff}%d\n", str, AccInfo[player1][Level]);

    format(str, sizeof(str), "%s{ffe100}Vip Level: {ffffff}%d\n", str, AccInfo[player1][pVip]);

    format(str, sizeof(str), "%s{FF6600}Others Statistics\n", str);

format(str, sizeof(str), "%s{ffe100}Kills: {ffffff}%d\n", str, AccInfo[player1][Kills]);

    format(str, sizeof(str), "%s{ffe100}Deaths: {ffffff}%d\n", str, AccInfo[player1][Deaths]);

    format(str, sizeof(str), "%s{ffe100}Ratio: {ffffff}%d\n", str, Float:AccInfo[player1][Kills]/Float:pDeaths);

    format(str, sizeof(str), "%s{ffe100}Ping: {ffffff}%d\n", str, GetPlayerPing(player1));

    ShowPlayerDialog(playerid, 8435, DIALOG_STYLE_MSGBOX, "Player Statistics", str, "Close", "");

    return 1;

}[/pawn]

Si merge si e tot la fel de usor.

Sunt un retardat

Link to comment
Share on other sites

T/C. 2 days+ without reply.

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.