16.10.2015, 20:36
Hello, can someone help me to convert this stats command to /stats id? So if i do /stats i can see my stats, and if i do /stats 0 or /stats Face9000 i can see others stats.
Thanks
Код:
CMD:stats(playerid, params[]) { if(GetPVarInt(playerid, "spawned") == 0) return SCM(playerid, COLOR_LIGHTBLUE, "Please spawn before doing any action."); if(GetPVarInt(playerid,"CmdTime")>GetTickCount())return SCM(playerid,0xFF0000FF,"Please wait before using this command again."); new Float:gihp, Float:giar; GetPlayerHealth(playerid, gihp); GetPlayerArmour(playerid, giar); new temp[1500]; new info[1500]; new Float:Ratio = (float(GetPlayerScore(playerid))/float(UserInfo[playerid][Deaths])); strcat(info,"{53C506}Financial Stats:\n\n"); format(temp, sizeof(temp), "{FFFFFF}Money: {F2C80C}%i\n\n",GetPlayerCash(playerid)); strcat(info, temp); format(temp, sizeof(temp), "{FFFFFF}Cookies: {F2C80C}%d\n\n",UserInfo[playerid][Cookies]); strcat(info, temp); strcat(info,"{53C506}Other Stats:\n\n"); format(temp, sizeof(temp), "{FFFFFF}Account ID: {F2C80C}%d\n\n",UserInfo[playerid][ID]); strcat(info, temp); format(temp, sizeof(temp), "{FFFFFF}Registration Date: {F2C80C}%s\n\n",UserInfo[playerid][RegisterDate]); strcat(info, temp); format(temp, sizeof(temp), "{FFFFFF}Level: {F2C80C}%s (%d)\n\n",AdminLevelToName(playerid),UserInfo[playerid][Admin]); strcat(info, temp); format(temp, sizeof(temp), "{FFFFFF}Vip: {F2C80C}%s (%d)\n\n",VipName(playerid),UserInfo[playerid][VIP]); strcat(info, temp); format(temp, sizeof(temp), "{FFFFFF}Score: {F2C80C}%i\n\n",GetPlayerScore(playerid)); strcat(info, temp); format(temp, sizeof(temp), "{FFFFFF}Deaths: {F2C80C}%d\n\n",UserInfo[playerid][Deaths]); strcat(info, temp); format(temp, sizeof(temp), "{FFFFFF}Ratio between Kills/Deaths: {F2C80C}%.3f\n\n",Ratio); strcat(info, temp); strcat(info,"{53C506}Mission Stats:\n\n"); format(temp, sizeof(temp), "{FFFFFF}Missions Played: {F2C80C}%d\n\n",UserInfo[playerid][MissionsPlayed]); strcat(info, temp); format(temp, sizeof(temp), "{FFFFFF}Last Man Standing Wins: {F2C80C}%d\n\n",UserInfo[playerid][LmsWins]); strcat(info, temp); ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX,"{FFFFFF}Your Current Stats",info,"Close",""); SetPVarInt(playerid,"CmdTime",GetTickCount()+5000); return true; }