Loading an ip in y_ini
#3

Quote:
Originally Posted by ******
Посмотреть сообщение
If you read the y_ini tutorial you will see that variables are loaded in to globals and dealt with after the INI_ParseFile line.
Global variables? You mean something like.. pInfo[playerid][IP]? If so, I can't! I want to open an offline player's file. So they don't have an ID([playerid]).

EDIT: I understand now. But there's one problem
pawn Код:
new pIP[16]; //global

forward loadip(name[],value[]);
public loadip(name[],value[])
{
    INI_String("IP", pIP, 16);
    return 1;
}

CMD:unban(playerid, params[])
{
    new name[24],str[128];
    if(sscanf(params, "s[24]", name)) return SendClientMessage(playerid, -1, ""herror" Usage: /unban [Player name]");
    format(str,sizeof(str),UserPath,name);
    if(!fexist(str)) return SendClientMessage(playerid, red, "Player is not banned/found!");
    new INI:file = INI_Open(str);
    INI_SetTag(file,"PlayerData");
    INI_WriteInt(file,"Banned",0);
    INI_Close(file);
   
    INI_ParseFile(str,"loadip",.bExtra = true);
    format(str,sizeof(str),"unbanip %s",pIP);
    SendRconCommand(str);
    printf("%s",str); //////////////////////


    return 1;
}
It prints "unbanip Year" and something like, "Spos3SpawnAngle". Those are from my accounts keywords(?)
Reply


Messages In This Thread
Loading an ip in y_ini - by newbienoob - 03.04.2013, 06:55
Re: Loading an ip in y_ini - by Sithis - 03.04.2013, 08:59
Re: Loading an ip in y_ini - by newbienoob - 20.04.2013, 17:19
Re: Loading an ip in y_ini - by newbienoob - 21.04.2013, 08:37
Re: Loading an ip in y_ini - by newbienoob - 22.04.2013, 13:43
Re: Loading an ip in y_ini - by newbienoob - 22.04.2013, 13:48
Re: Loading an ip in y_ini - by newbienoob - 22.04.2013, 13:59

Forum Jump:


Users browsing this thread: 1 Guest(s)