Dini help
#1

Whats wrong with this code....

I do /ips ID the IP's Used: then it dosnt display any , it should atleast display 127.0.0.1

pawn Код:
new plname[MAX_PLAYER_NAME];
    new playersip[64];
    new string[128];
    format(pFILE[playerid], 128, "users/Aliases/%s.txt", plname);
    dini_Create(pFILE[playerid]);
    dini_Set(pFILE[playerid], "Nameip", playersip);

    if(strlen(dini_Get("users/Aliases/ips.txt", plname)) == 0)
    {
        dini_Set("users/Aliases/ips.txt", plname, playersip);
    }
    else
    {
        if( strfind( dini_Get("users/Aliases/ips.txt", plname), playersip, true) == -1 )
        {
            format(string,sizeof(string),"%s, %s", dini_Get("users/Aliases/ips.txt",plname), playersip);
            dini_Set("users/Aliases/ips.txt", plname, string);
        }
    }

    new pAKA[256];
    pAKA = dini_Get("users/Aliases/alias.txt",playersip);
    new pIPs[256];
    pIPs = dini_Get("users/Aliases/ips.txt",plname);
pawn Код:
CMD:ips(playerid,params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1 || IsPlayerAdmin(playerid))
    {
        new giveplayerid;
        if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GRAD1, "USAGE: /ips [playerid]");

        new playername[MAX_PLAYER_NAME], str[128];

        if(IsPlayerConnected(giveplayerid) && giveplayerid != INVALID_PLAYER_ID)
        {
            GetPlayerName(giveplayerid, playername, sizeof(playername));
            format(str,sizeof(str),"IPs Used for %s (%d) are: %s", playername, giveplayerid, dini_Get("users/Aliases/ips.txt",playername) );
            return SendClientMessage(playerid,COLOR_GREY,str);
        }
        else return SendClientMessage(playerid, COLOR_GREY, "* Player is not connected or is yourself");
    }
    else return SendClientMessage(playerid,COLOR_GREY,"* ERROR: You are not a high enough level to use this command");
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)