player stats
#8

Oke I will give you a example with zcmd and sscanf, if you don't want to use this you should compile this to strcmp yourself. assuming that you saved these statics somewhere and can call it with your enum pInfo I would say this must work for you:

pawn Код:
#define DIALOG_USERSTATS 1234
//^ this is the dialog id for the userstatics, place this on top of your script under de includes

COMMAND:stats(playerid, params[]) {//defining the command that must be entered to control this dialog.
    new targetid;//this is needed to check the targetid's stats in the sscanf switch.
    if(!sscanf(params, "U(-1)", targetid)) {//this is giving a optinal paramater (the targetid), when the command is called without a targetid it will show your stats.
        //this is the playerid dialog
        new string[2000];//now we are making a new string to show up in the dialog
        strcat(string, "KIlls: %d\n", PlayerInfo[playerid][pKills]);//this is formating your string
        strcat(string, "Deaths: %d\n", PlayerInfo[playerid][pDeaths]);
        strcat(string, "Money: %d\n", PlayerInfo[playerid][pCash]);//copy this with whatever you want to show in the dialog    
        ShowPlayerDialog(playerid, DIALOG_USERSTATS, DIALOG_STYLE_MSGBOX, "Your statics", string, "OK", "");
     } else {
        //this is the targetid dialog
        new string[2000];//now we are making a new string to show up in the dialog
        strcat(string, "KIlls: %d\n", PlayerInfo[targetid][pKills]);//this is formating your string
        strcat(string, "Deaths: %d\n", PlayerInfo[targetid][pDeaths]);
        strcat(string, "Money: %d\n", PlayerInfo[targetid][pCash]);//copy this with whatever you want to show in the dialog    
        ShowPlayerDialog(playerid, DIALOG_USERSTATS, DIALOG_STYLE_MSGBOX, "Target statics", string, "OK", "");
    }
    return 1;
}
I hope this helped you I didnt tested it! If this is not working please contact me or find our what is wrong

Kind regarts, Jordy
Reply


Messages In This Thread
player stats - by OpticKiller - 14.05.2013, 22:42
Re: player stats - by [L]azy[H]aze - 14.05.2013, 22:46
Re: player stats - by jordy.kiesebrink - 14.05.2013, 22:49
Re: player stats - by OpticKiller - 14.05.2013, 22:52
Re: player stats - by jordy.kiesebrink - 14.05.2013, 22:56
Re: player stats - by OpticKiller - 15.05.2013, 00:19
Re: player stats - by RvGamers - 15.05.2013, 03:24
Re: player stats - by jordy.kiesebrink - 15.05.2013, 13:44
Re: player stats - by OpticKiller - 15.05.2013, 18:55
Re: player stats - by jordy.kiesebrink - 17.05.2013, 22:18

Forum Jump:


Users browsing this thread: 1 Guest(s)