27.09.2013, 22:45
Hi. I would like to ask for a help who can make this to dialog box. Thank you very much!
Like this format below.
Player Stats(This is the title of the box)
Name: Thisisme (ID: 5)
Score: 42
Kills: 32
Deaths: 23
Money: 1000
Time logged in: 3 hours 4 minutes
and so on...
ALSO ADDITIONAL: When I target a player stats like /stats 32 (sample player ID) it will change the name the targeted player same with his current stats.
Like this format below.
Player Stats(This is the title of the box)
Name: Thisisme (ID: 5)
Score: 42
Kills: 32
Deaths: 23
Money: 1000
Time logged in: 3 hours 4 minutes
and so on...
ALSO ADDITIONAL: When I target a player stats like /stats 32 (sample player ID) it will change the name the targeted player same with his current stats.
Код:
CMD:stats(playerid,params[]) { new id, h, m, d; sscanf(params, "u", id); if (isnull(params)) { new seconds = gettime() - pInfo[playerid][ConnectedTime] + pInfo[playerid][TotalSecs]; format(Jstring, sizeof(Jstring), "_Statistics for '%s'_",GetName(playerid)); SendClientMessage(playerid, green, Jstring); format(Jstring, sizeof(Jstring), "Score: %d | Money: $%d | Kills: %d | Deaths: %d | Ratio: %0.2f | Total spent Time: %s", GetPlayerScore(playerid), GetPlayerMoney(playerid), pInfo[playerid][Kills], pInfo[playerid][Deaths], Float:pInfo[playerid][Kills]/Float:pInfo[playerid][Deaths], ConvertTime(seconds,m,h,d)); return SendClientMessage(playerid, yellow, Jstring); } else if(IsPlayerConnected(id)) { new seconds = gettime() - pInfo[id][ConnectedTime] + pInfo[id][TotalSecs]; format(Jstring, sizeof(Jstring), "_Statistics for '%s'_",GetName(id)); SendClientMessage(playerid, green, Jstring); format(Jstring, sizeof(Jstring), "Score: %d | Money: $%d | Kills: %d | Deaths: %d | Ratio: %0.2f | Total spent Time: %s", GetPlayerScore(id), GetPlayerMoney(id), pInfo[id][Kills], pInfo[id][Deaths], Float:pInfo[id][Kills]/Float:pInfo[id][Deaths], ConvertTime(seconds,m,h,d)); return SendClientMessage(playerid, yellow, Jstring); } else return ShowMessage(playerid, red, 2); }