SA-MP Forums Archive
/stats command - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /stats command (/showthread.php?tid=152937)



/stats command - Jonni8 - 06.06.2010

Hey gus,

I just made command to check the players stats.
But when i use it the fields are free and the stats dont show up...

CODE:
pawn Код:
CMD:stats(playerid, params[])
{
    new pname[56];
    new psprache[56];
    new string1[256];
    new string2[256];
   
    GetPlayerName(playerid, pname, sizeof(pname));
    if (Player[playerid][Sprache] == GERMAN)
    {
        psprache = "Deutsch";
    }
    else
    {
        psprache = "English";
    }
   
    SendClientMessage(playerid, RED, "----------STATS----------\n");
    if (Player[playerid][Sprache] == GERMAN)
    {
        format(string1, sizeof(string1), "Name: %s \tSprache: %s", pname, Player[playerid][Sprache]);
        format(string2, sizeof(string2), "Kills: %d \tTode: %d", Player[playerid][Kills], Player[playerid][Tode]);
    }
    else
    {
        format(string1, sizeof(string1), "Name: %s \tLanguage: %s", pname, Player[playerid][Sprache]);
        format(string2, sizeof(string2), "Kills: %d \tDeaths: %d", Player[playerid][Kills], Player[playerid][Tode]);
    }
    SendClientMessage(playerid, GREEN, string1);
    SendClientMessage(playerid, GREEN, string2);
    SendClientMessage(playerid, RED, "-----------------------------------\n");
    return 1;
}
and here is my PlayerData-enum and Player-Array:
pawn Код:
enum PlayerData
{
    Kills,
    Tode,
    Sprache,
    ALevel,
    Eingeloggt
}
new Player[MAX_PLAYERS][PlayerData];
Maybe you know the problem.


//EDIT:

Maybe u know how to make a function to check if the player is freezed too.
Because i have to check that for my freeze/unfreeze commands.


Re: /stats command - Jonni8 - 06.06.2010

Please help...
Just say if u need more code.


Re: /stats command - MadeMan - 06.06.2010

Quote:
Originally Posted by тħeρяш
But when i use it the fields are free and the stats dont show up...
I don't understand what you mean?


Re: /stats command - Jonni8 - 06.06.2010

So when i type in /stats there is show
Quote:

Name: "playername" Sprache: [let out]
Kills: [let out] Tode: [let out]

but there should come up:
Quote:

Name: "playername" Sprache: English
Kills: 1...2...3(however) Tode: same




Re: /stats command - MadeMan - 06.06.2010

Use psprache

pawn Код:
format(string1, sizeof(string1), "Name: %s \tLanguage: %s", pname, psprache);



Re: /stats command - Jonni8 - 06.06.2010

Okay, lol i scripted it but didnt use it ROFL

Another question...
I use REL Streamer plugin to make a weaponpickup.
can i display the weapon as pickup? because there is no pickup shown but when i go to the position i get the weapon. ?


Re: /stats command - Jonni8 - 06.06.2010

So Well. I fixed my /stats Problem.
I will open a new topic for my second question.


Re: /stats command - Jonni8 - 06.06.2010

deleted...