25.03.2013, 19:26
Hey guys...
when an admin bans a player (including writing the reason) when the players relog it tells him you are banned etc.... reason: (not written)
check
NOTE: It tells me "You Are Banned From The Server (Reason: )" when i'm banned without writing the reason -_-
WHAT IS THE PROBLEM? WHY IT ISN'T WRITING THE REASON WHEN PLAYER CONNECTS AND HE IS BANNED??
NOTE: the reason is written in the scriptfile (player STats)
when player is banned and enter game and for ex the ban reason is Hack it
says :
You Are Banned From The Server (Reason: )
it didn't write reason: Hack
when an admin bans a player (including writing the reason) when the players relog it tells him you are banned etc.... reason: (not written)
check
pawn Код:
command(ban, playerid, params[])
{
if(sscanf(params, "is[128]", player, reason)) return SendClientMessage(playerid, ROJOO,"USAGE: /ban [id] [reason]");
{
SInfo[player][BReason] = reason;
kick(player);
}
return 1;
}
pawn Код:
enum PlayerInfo
{
BReason[128]
}
pawn Код:
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
new str2[128];
INI_String("BanReason",str2,128);
SInfo[playerid][BReason]=str2;
return 1;
}
pawn Код:
public OnPlayerConnect(playerid)
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
if(SInfo[playerid][Banned] == 1)
{
new string[254];
format(string, sizeof(string), "You Are Banned From The Server (Reason: %s)", SInfo[playerid][BReason]);
SendClientMessage(playerid, COLOR_RED, string);
}
return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteString(File,"Reason",SInfo[playerid][BReason]);
INI_Close(File);
return 1;
}
NOTE: the reason is written in the scriptfile (player STats)
when player is banned and enter game and for ex the ban reason is Hack it
says :
You Are Banned From The Server (Reason: )
it didn't write reason: Hack