Offline player stats
#1

Hey guys i have this command that im putting into my new script and it should get offline players money,admin rank ect but it is only getting the ammount of money the player has

pawn Код:
CMD:getplayerstats(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >=3)
    {
    if(isnull(params)) {
        return SendClientMessage(playerid, -1, "Correct Usage: /getplayerstats [player name]");
    }

    new filename[MAX_PLAYER_NAME+18];
    format(filename, sizeof(filename), "/data/userdata/%s.ini", params);

    if(!fexist(filename)) {
        return SendClientMessage(playerid, -1, "This Account Was Not Found Please Check The Spelling EG: Jack_Rapter");
    }

    new
        File:file = fopen(filename, io_read),
        string[128],
        string2[129],
        string3[129],
        Name[20],
        Value[20],
        Value2[20],
        cash,
        admin,
        banned,
        bannedresult[500],
        Adminrank[500];

    while(fread(file, string)) {
        if(!sscanf(string, "p<=>s[20]s[20]", Name, Value,Value2)) {
            if(!strcmp(Name, "Cash ")) {
                cash = strval(Value);
                break;
            }
            else if(!strcmp(Name, "Admin ")) {
                admin = strval(Value2);
                break;
            }
        }
    }
    switch(banned)
    {
      case 0: bannedresult = "No";
      case 1: bannedresult = "Yes";
    }
    switch(admin)
    {
      case 0: Adminrank = "Not A Staff Member";
      case 1: Adminrank = "Trial Staff Member";
      case 2: Adminrank = "Moderator";
      case 3: Adminrank = "Administrator";
      case 4: Adminrank = "Co-Owner";
      case 5: Adminrank = "Owner";
    }
    format(string, sizeof(string), "Money: %d",cash);
    format(string3, sizeof(string3), "Staff Status: %s",Adminrank);
    format(string2, sizeof(string2), "|-- %s's account stats are --|", params);
    SendClientMessage(playerid, -1, string2); // Top Text Displaying Name
    SendClientMessage(playerid, -1, string); // Money
    SendClientMessage(playerid, -1, string3); // Staff Rank
    return true;
    }
    else
    {
   
        SendClientMessage(playerid,-1,"Your Not Part Of The Server Staff Team -_-");
        return 1;
   
    }
}
Reply
#2

Any one?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)