SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 11/01/2011, 04:42 AM   #1
Lorenc_
High-roller
 
Lorenc_'s Avatar
 
Join Date: Jan 2010
Location: Australia
Posts: 3,793
Reputation: 1179
Default y_ini - reading something dosent work

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_
__________________
Join the best Cops And Robbers in SA-MP, today. svr.sfcnr.com:7777

Lorenc_ is offline  
Old 11/01/2011, 04:46 AM   #2
Steven82
High-roller
 
Join Date: Nov 2009
Posts: 2,431
Reputation: 186
Default Re: y_ini - reading something dosent work

I am lol'ing but sucks i don't know how to use y_ini D:
__________________
If you read my old posts; I apologize in advance.
Steven82 is offline  
Old 11/01/2011, 05:15 AM   #3
Lorenc_
High-roller
 
Lorenc_'s Avatar
 
Join Date: Jan 2010
Location: Australia
Posts: 3,793
Reputation: 1179
Default Re: y_ini - reading something dosent work

D: you really are bored, i can tell.
__________________
Join the best Cops And Robbers in SA-MP, today. svr.sfcnr.com:7777

Lorenc_ is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
y_ini Reading GiS Help Archive 10 09/01/2011 11:07 AM
Y_INI reading help armyoftwo Help Archive 9 03/01/2011 10:50 AM
My Sa-mp Dosent work. Nondor Client Support 1 03/09/2009 08:59 PM
SA-MP dosent work laser50 Client Support 1 21/08/2009 09:31 PM


All times are GMT. The time now is 12:48 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.