11.01.2011, 04:42
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:
The showban function:
LoadBannedUser callback:
This is how it looks like when i ban my self(the player file)
All of this ends up to:
WELP!
-Lorenc_
D:
Heres my code:
OnPlayerConnect:
pawn Code:
public OnPlayerConnect(playerid)
{
if(INI_Exist(INI_BAN_FILE, ReturnPlayerName(playerid)))
{
ShowBan(playerid);
return 0;
}
return 1;
}
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);
}
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);
}
}
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
WELP!
-Lorenc_