08.01.2010, 20:58
Does anyone know what is wrong with this code?
If you do "/stats ID" it shows your own stats. How can I make it so it shows the stats of the ID I chose?
Thanks for the help.
Код:
dcmd_stats(playerid,params[]) { new player1; new name[MAX_PLAYERS]; new string[128]; if(!strlen(params)) player1 = playerid; else player1 = strval(params); if(IsPlayerConnected(player1)) { format(string, sizeof(string),"%s's Stats\n\nKills: %d\nDeaths: %d\nRatio: %0.2f\nMoney: %d", name[player1], PlayerInfo[player1][Kills], PlayerInfo[player1][Deaths], PlayerInfo[player1][Kills]/Float:Deaths,GetPlayerMoney(player1)); return ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_MSGBOX, "Stats", string, "Ok", "Exit"); } else return SendClientMessage(playerid, COLOR_RED, "Player Not Connected!"); }
Thanks for the help.