SA-MP Forums Archive
y_ini - reading something dosent work - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: y_ini - reading something dosent work (/showthread.php?tid=209673)



y_ini - reading something dosent work - Lorenc_ - 11.01.2011

Ey guys yea i was converting all this dini crap to y_ini and suddenly i created a ban command which fails in loading...

D:

Heres my code:
OnPlayerConnect:
pawn Code:
public OnPlayerConnect(playerid)
{
    if(INI_Exist(INI_BAN_FILE, ReturnPlayerName(playerid)))
    {
        ShowBan(playerid);
        return 0;
    }
        return 1;
}
The showban function:
pawn Code:
stock ShowBan(playerid)
{
    new file[64], string[256];
    format(file, sizeof(file), INI_BAN_FILE, ReturnPlayerName(playerid));
    INI_ParseFile(file, "LoadBannedUser", false, true, playerid, true, false);
    format(string, 256, "You are banned from this server. If you've feel you have been wrongfully ban please reply at "#SERVER_WEBSITE"\n\n"COL_RED"BANNED BY: %s\nBANNED DATE: %s\nBANNED TIME: %s\nBANNED REASON: %s", GetPVarInt(playerid, "bPlayer"),GetPVarInt(playerid, "bDate"),GetPVarInt(playerid, "Time"),GetPVarInt(playerid, "bReason"));
    ShowPlayerDialog(playerid, DIALOG_INFO, DIALOG_STYLE_MSGBOX, "Call of Duty: Blackops", string, "Ok", "");
    Kick(playerid);
}
LoadBannedUser callback:
pawn Code:
forward LoadBannedUser(playerid, name[], value[]);
public LoadBannedUser(playerid, name[], value[])
{
    if (!strcmp(name, "BAN_REASON")) {
        SetPVarString(playerid, "bReason", value);
    }
    if (!strcmp(name, "BAN_DATE")) {
        SetPVarString(playerid, "bDate", value);
    }
    if (!strcmp(name, "BAN_TIME")) {
        SetPVarString(playerid, "bTime", value);
    }
    if (!strcmp(name, "BAN_BY")) {
        SetPVarString(playerid, "bPlayer", value);
    }
}
This is how it looks like when i ban my self(the player file)
Code:
BAN_IP = 5.57.93.125
BAN_REASON = hello lets test
BAN_DATE = 11/January/2011
BAN_TIME = 16/33/19
BAN_BY = Lorenc
All of this ends up to:


WELP!

-Lorenc_


Re: y_ini - reading something dosent work - Steven82 - 11.01.2011

I am lol'ing but sucks i don't know how to use y_ini D:


Re: y_ini - reading something dosent work - Lorenc_ - 11.01.2011

D: you really are bored, i can tell.