CMD:stats(playerid, params[]) { new target; if(sscanf(params, "u", target)) { target = playerid; Server(playerid, "You can also use /stats [playerid]"); } if(!IsPlayerConnected(target)) return Error(playerid, "Player is not connected."); if(User[target][loggedin] == 0) return Error(playerid, "Player is not logged in."); GetPlayerConnectedTime(target, User[target][ohours], User[target][ominutes], User[target][oseconds]); new DIALOG[1000], string[312], data[2][48], yes[4] = "Yes", no[3] = "No", Float:ratio ; new handle = SQL::OpenEx(SQL::READ, ""PLAYERS_TABLE"", "username", GetName(target)); SQL::ReadString(handle, "joined", data[1], 48); SQL::Close(handle); format(string, sizeof(string), ""purple"NRG Stats for %s's (ID:%i):\n\n", GetName(target), target); strcat(DIALOG, string); strcat(DIALOG, ""lightred"Main Statistics:\n"); format(string, sizeof(string), ""white"•"lightblue"Account ID: "green"%i\n", User[target][id]); strcat(DIALOG, string); format(string, sizeof(string), ""white"•"lightblue"Registered date: "green"%s\n", data[1]); strcat(DIALOG, string); format(string, sizeof(string), ""white"•"lightblue"Online Time: "green"%02i hours %02i minutes %02i seconds\n", User[target][ohours], User[target][ominutes], User[target][oseconds]); strcat(DIALOG, string); format(string, sizeof(string), ""white"•"lightblue"Kills: "green"%i\n", User[target][kills]); strcat(DIALOG, string); format(string, sizeof(string), ""white"•"lightblue"Deaths: "green"%i\n", User[target][deaths]); strcat(DIALOG, string); if(User[target][deaths] <= 0) ratio = 0.0; else ratio = floatdiv(User[target][kills], User[target][deaths]); format(string, sizeof(string), ""white"•"lightblue"K/D Ratio: "green"%0.2f\n", ratio); strcat(DIALOG, string); format(string, sizeof(string), ""white"•"lightblue"Score: "green"%i\n", GetPlayerScore(target)); strcat(DIALOG, string); format(string, sizeof(string), ""white"•"lightblue"Money: "green"$%i\n", GetPlayerMoney(target)); strcat(DIALOG, string); format(string, sizeof(string), ""white"•"lightblue"Cookies: "green"%i\n\n", User[target][cookies]); strcat(DIALOG, string); strcat(DIALOG, ""lightred"Event Statistics:\n"); format(string, sizeof(string), ""white"•"lightblue"Math Wins: "green"%i\n", User[target][maths]); strcat(DIALOG, string); format(string, sizeof(string), ""white"•"lightblue"Moneybag Founds: "green"%i\n", User[target][mbfound]); strcat(DIALOG, string); format(string, sizeof(string), ""white"•"lightblue"ReactionContest Wins: "green"%i\n\n", User[target][reactions]); strcat(DIALOG, string); strcat(DIALOG, ""lightred"Other Statistics:\n"); format(string, sizeof(string), ""white"•"lightblue"Wanteds: "green"%i\n", User[target][wanteds]); strcat(DIALOG, string); format(string, sizeof(string), ""white"•"lightblue"Admin Level: "green"%i\n", User[target][level]); strcat(DIALOG, string); format(string, sizeof(string), ""white"•"lightblue"VIP Level: "green"%i\n", User[target][vip]); strcat(DIALOG, string); format(string, sizeof(string), ""white"•"lightblue"Trusted Player: "green"%s\n", ((IsPlayerTrusted(target)) ? yes : no)); strcat(DIALOG, string); format(string, sizeof(string), ""white"•"lightblue"Jailed: "green"%s\n", ((IsPlayerJailed(target)) ? yes : no)); strcat(DIALOG, string); format(string, sizeof(string), ""white"•"lightblue"Muted: "green"%s\n", ((IsPlayerMuted(target)) ? yes : no)); strcat(DIALOG, string); format(string, sizeof(string), ""white"•"lightblue"Command Muted: "green"%s\n", ((IsPlayerCMDMuted(target)) ? yes : no)); strcat(DIALOG, string); format(string, sizeof(string), ""white"•"lightblue"Warnings: "green"%i/%i\n", User[target][warns], MAX_WARNS); strcat(DIALOG, string); Dialog_Show(playerid, dialogUnused, DIALOG_STYLE_MSGBOX, "NRG Statistics", DIALOG, "Close", ""); return 1; }
Thanks everyone for helping and i figured it out it was a mistake of one of my scripts fixed it! , thanks jlalt for the CrashDetect and BlackBirdXD , if you want to know give me a pm and ill tell you
|
Thanks everyone for helping and i figured it out it was a mistake of one of my scripts fixed it! , thanks jlalt for the CrashDetect and BlackBirdXD , if you want to know give me a pm and ill tell you
|
Why not You tell here or post tutorial If Newbies Like me Come to this section They probably getting Something to learn new things.
|