Jump to content
  • 0

/stats


Deejaybwg

Question

Am adaugat cate ceva in comanda /stats:

Comanda:

[pawn]dcmd_stats(playerid,params[]) {

    new string[428], pDeaths, 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];

        if(AccInfo[player1][score] == 0) pScores = 1; else pScores = AccInfo[player1][score]

        if(AccInfo[player1][Admin Level] == 0) pAdmin Level = 1; else pAdmin Level = AccInfo[player1][Admin Level]

        if(AccInfo[player1][VIP Level] == 0) pVIP Level = 1; else pVIP Level = AccInfo[player1][VIP Level]

if(AccInfo][player1][skin] == 0) pSkin = 1; else pSkin = AccInfo[player1]Skin]

        format(string, sizeof(string), "| {FFFFFF}%s{00C0FF}'s Stats \n{FFFFFF}Player Kills: {00C0FF}%d \n{FFFFFF}Player Deaths: {00C0FF}%d \n{FFFFFF}Player Ratio: %0.2f \n{FFFFFF}Player Money: {00C0FF}$%d \nPlayer Score: {00C0FF}%d \n{FFFFFF}Player Skin: {00C0FF}%d \n{FFFFFF}Player Time: \n{FFFFFF}%d{FFAF00}*{FFAF00}hrs \n{FFFFFF}%d{FFAF00}*{FFFFFF}mins \n{FFFFFF}%d{FFAF00}*{FFAF00}secs \n{FFFFFF}Admin Level - {00C0FF}%d \n{FFFFFF}VIP Level - {00C00FF}%d \n ",PlayerName2(player1), AccInfo[player1][Kills], AccInfo[player1][Deaths], Float:AccInfo[player1][Kills]/Float:pDeaths,AccInfo[player1][score],AccInfo[player1][Admin Level],AccInfo[player1][VIP Level],GetPlayerMoney(player1),GetPlayerScore(player1), h, m, s);

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

    } else return SendClientMessage(playerid, red, "Player Not Connected!");

}[/pawn]

Dupa compile:

C:\Users\Bwggu\Desktop\LuxAdmin.pwn(1648) : error 017: undefined symbol "Score"

C:\Users\Bwggu\Desktop\LuxAdmin.pwn(1648) : error 017: undefined symbol "pScores"

C:\Users\Bwggu\Desktop\LuxAdmin.pwn(1648) : warning 215: expression has no effect

C:\Users\Bwggu\Desktop\LuxAdmin.pwn(1648) : error 029: invalid expression, assumed zero

C:\Users\Bwggu\Desktop\LuxAdmin.pwn(1648) : fatal error 107: too many error messages on one line

Nu am reusit sa rezolv.. As vrea sa mearga bine /stats si sa nu mai dea erori/warn-uri.

www.youtube.com/thebwgg

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

Am incercat.. E prima oara.. NU REUSESC DELOC.

Daca cineva poate sa-mi dea comanda buna ? Cum am facut-o eu, dar sa mearga bine.. Daca nu, voi incerca pas cu pas daca ma ajuta cineva..

EDIT:

Am facut alta comanda:

[pawn]dcmd_stats(playerid,params[]) {

    new string[428], pDeaths, 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), "| {FFFFFF}%s{00C0FF}'s Stats \n{FFFFFF}Player Kills: {00C0FF}%d \n{FFFFFF}Player Deaths: {00C0FF}%d \n{FFFFFF}Player Ratio: %0.2f \n{FFFFFF}Player Money: {00C0FF}$%d \nPlayer Score: {00C0FF}%d \n{FFFFFF}Player Skin: {00C0FF}%d \n{FFFFFF}Player Time: \n{FFFFFF}%d{FFAF00}*{FFAF00}hrs \n{FFFFFF}%d{FFAF00}*{FFFFFF}mins \n{FFFFFF}%d{FFAF00}*{FFAF00}secs \n{FFFFFF}Admin Level - {00C0FF}%d \n{FFFFFF}VIP Level - {00C00FF}%d \n ",PlayerName2(player1), AccInfo[player1][Kills], AccInfo[player1][Deaths], Float:AccInfo[player1][Kills]/Float:pDeaths,AccInfo[player1][score],AccInfo[player1][Admin Level],AccInfo[player1][VIP Level],GetPlayerMoney(player1),GetPlayerScore(player1),GetPlayerSkin(player1), h, m, s);

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

    } else return SendClientMessage(playerid, red, "Player Not Connected!");

}[/pawn]

www.youtube.com/thebwgg

Link to comment
Share on other sites

nu ai definit pScore si Score...

nu inteleg la ce ai pus:

AccInfo[player1][score] - Care cred ca arata cat score are playerul

si ai mai pus GetPlayerScore.... ii tot aia...

Uite ti-a zis el.

Din cate vad tu vrei sa faci sa se salveze scorui, atunci iate dupa killes/death sau ce mai ai.. la onplayerlogin , register sau unde ai tu 8->

 

Link to comment
Share on other sites

[pawn]#if defined USE_STATS

dcmd_stats(playerid,params[]) {

    new rankid = pRank[playerid];

    new plName[MAX_PLAYER_NAME];

    GetPlayerName(playerid, plName, sizeof(plName));

  new rank[20];

  if(pRank[playerid] == 0) { rank = "Newbie"; }

    else if(pRank[playerid] == 1) { rank = "Baby Killa'"; }

    else if(pRank[playerid] == 2) { rank = "Soldier"; }

    else if(pRank[playerid] == 3) { rank = "Gangsta'"; }

    else if(pRank[playerid] == 4) { rank = "Underboss"; }

    else if(pRank[playerid] == 5) { rank = "Tha' Boss"; }

    new string[9999], sL[50], sI[500], pDeaths, player1, h, m, s;

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

    else player1 = strval(params);

    if(IsPlayerConnected(player1)) {

        TotalGameTime(player1, h, m, s);

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

        format(sL, sizeof(sL), "{fff000}-------------------------------------------");

        format(sI, sizeof(sI), "{00FF19}Rank: {00CEFC}%d ({FC0303}%s{00FF19})\n{00FF19}Admin Level: {00CEFC}%d\n",rankid,rank,PlayerInfo[player1][Level],PlayerInfo[player1][Warnings],PlayerInfo[player1][RegisteredDate]);

        format(string, sizeof(string),"%s\n{FC0303}%s{00FF19}'s Stats\n%s\n{00FF19}Player Kills:{00CEFC}%d\n{00FF19}Player Deaths:{00CEFC}%d\n{00FF19}Player Ratio:{00CEFC}%0.2f\n{00FF19}Player Money:{00CEFC}$%d\n{00FF19}Player Time:\n{00CEFC}%d{FC0303}*{00FF19}hrs\n{00CEFC}%d{FC0303}*{00FF19}mins\n{00CEFC}%d{FC0303}*{00FF19}secs\n\%s\n%s",sL,PlayerName2(player1),sL,PlayerInfo[player1][Kills],PlayerInfo[player1][Deaths],Float:PlayerInfo[player1][Kills]/Float:pDeaths,GetPlayerMoney(player1),h,m,s,sI,sL);

        return ShowPlayerDialog(playerid, 9999, 0, "Player Stats", string, "Ok", "");

    } else return SendClientMessage(playerid, red, "Player Not Connected!");

}

#endif

#endif[/pawn]

Hitman Incearca asa cu asta si sa sti ca statsu asta merge doar la (ladmin)

560x95_FFFFFF_FF9900_000000_000000.png
Link to comment
Share on other sites

Comanda:

[pawn]#if USE_STATS == true

dcmd_stats(playerid,params[]) {

    new string[428], pDeaths, 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), "| {FFFFFF}%s{00C0FF}'s Stats \n{FFFFFF}Player Kills: {00C0FF}%d \n{FFFFFF}Player Deaths: {00C0FF}%d \n{FFFFFF}Player Ratio: %0.2f \n{FFFFFF}Player Money: {00C0FF}$%d \nPlayer Score: {00C0FF}%d \n{FFFFFF}Player Skin: {00C0FF}%d \n{FFFFFF}Player Time: \n{FFFFFF}%d{FFAF00}*{FFAF00}hrs \n{FFFFFF}%d{FFAF00}*{FFFFFF}mins \n{FFFFFF}%d{FFAF00}*{FFAF00}secs \n{FFFFFF}Admin Level - {00C0FF}%d \n{FFFFFF}VIP Level - {00C00FF}%d \n ",PlayerName2(player1), AccInfo[player1][Kills], AccInfo[player1][Deaths], Float:AccInfo[player1][Kills]/Float:pDeaths,AccInfo[player1][score],AccInfo[player1][Admin Level],AccInfo[player1][VIP Level],GetPlayerMoney(player1),GetPlayerScore(player1),GetPlayerSkin(player1), h, m, s);

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

    } else return SendClientMessage(playerid, red, "Player Not Connected!");

}

#endif[/pawn]

www.youtube.com/thebwgg

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.