21.06.2018, 06:40
Quote:
Here you go.
PHP Code:
|
PHP Code:
CMD<ALL>:stats(cmdid, playerid, params[])
{
new targetid, string[128];
if(sscanf(params, "u", targetid)) targetid = playerid;
if(!IsPlayerConnected(targetid)) return SCM(playerid, COLOR_RED, NOPLAYER);
if(!LoggedIn[targetid]) return SCM(playerid, COLOR_RED, NOTLOGGEDIN);
SendClientMessage(playerid, COLOR_TOMATO, "");
format(string, sizeof(string), "..:: %s's account statistic ::..", GetName(targetid));
SendClientMessage(playerid, COLOR_TOMATO, string);
format(string, sizeof(string), "{FF0000}[WEAPON KILLS] {FFFFFF}Deagle: %d, Sniper: %d, M4: %d, Shotgun: %d, Combat: %d, MP5: %d, SawnOff: %d", UserStats[targetid][DeagleKills],UserStats[targetid][SniperKills],UserStats[targetid][M4Kills], UserStats[targetid][ShotgunKills],UserStats[targetid][CombatKills],UserStats[targetid][MP5Kills],UserStats[targetid][SawnOffKills]);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "{FF0000}[STATS] {FFFFFF}Kills: %d, Deaths: %d, Ratio: %0.2f, Hit accuracy: %d", UserStats[targetid][Kills],UserStats[targetid][Deaths],floatdiv(UserStats[targetid][Kills], UserStats[targetid][Deaths]), UserStats[targetid][WeaponHitsOnPlayer], UserStats[targetid][MissedWeaponHits]);
SendClientMessage(playerid, COLOR_WHITE, string);
SendClientMessage(playerid, COLOR_TOMATO, "");
return 1;
}