/stats help
#1

well my mistake of the /stats cmd i did a wrong explaination

anyway

CMDtats(playerid, params[])
{
new string[256], string2[256], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "%s's Statistics", PlayerName);
format(string2, sizeof(string2), "Vip Level: %d\nKills: %d\nDeaths: %d\nRatio: %0.2f\nMoney: %d", PlayerInfo[playerid][pVip], PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][pCash] );
ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, string, string2, "Ok", "Cancel");
return 1;
}

i wanted it to work like this
/stats = will show your own stats

/stats id/name = will show the dood's stats
Reply
#2

pawn Код:
CMD:stats(playerid, params[])
{
    new player;
    sscanf(params, "R(-1)", player);
    if(player==-1) player = playerid;
   
    new string[37], string2[128], PlayerName[MAX_PLAYER_NAME];
    GetPlayerName(player, PlayerName, sizeof(PlayerName));
    format(string, sizeof(string), "%s's Statistics", PlayerName);
    format(string2, sizeof(string2), "Vip Level: %d\nKills: %d\nDeaths: %d\nRatio: %0.2f\nMoney: %d", PlayerInfo[player][pVip], PlayerInfo[player][pKills], PlayerInfo[player][pDeaths], PlayerInfo[player][pCash] );
    ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, string, string2, "Ok", "Cancel");
    return 1;
}
Try that out
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)