if(pInfo[playerid][Banned] == 1)
{
SendClientMessage(playerid,RED,"You're banned from this server, You can't join.");
format(Jstring,sizeof(Jstring),"You're banned for reason: (%s).",pInfo[playerid][Breason]);
SendClientMessage(playerid,RED,Jstring);
SetTimerEx("ban2",1,0,"i",playerid);
}
INI_Int("Banned",pInfo[playerid][Banned]);
INI_String("Breason",pInfo[playerid][Breason],300);
pawn Код:
|
CMD:ban(playerid,params[])
{
if(pInfo[playerid][Admin] >= 3)
{
if(sscanf(params, "us", id, reason)) return SendClientMessage(playerid, RED,"Usage: /ban [id] [reason]");
new INI:ban1 = INI_Open(Path(id));
INI_SetTag(ban1, "Player's Data");
INI_WriteInt(ban1, "Banned", 1);
INI_WriteString(ban1, "Breason",reason);
INI_Close(ban1);
pInfo[id][Banned] = 1;
}
return 1;
}
forward loadaccount_user(playerid, name[], value[]);
public loadaccount_user(playerid, name[], value[])
{
INI_String("Password", pInfo[playerid][Pass],129);
INI_Int("Money",pInfo[playerid][Money]);
INI_Int("Scores",pInfo[playerid][Scores]);
INI_Int("Kills",pInfo[playerid][Kills]);
INI_Int("Deaths",pInfo[playerid][Deaths]);
INI_Int("AdminLvl",pInfo[playerid][Admin]);
INI_Int("Banned",pInfo[playerid][Banned]);
INI_String("Breason",pInfo[playerid][Breason],300);
return 1;
}
forward loadaccount_user(playerid, name[], value[]);
public loadaccount_user(playerid, name[], value[])
{
new INI:file = INI_Open(Path(id));
if(file == INI_NO_FILE) print("playerfile not accessible");
format(pInfo[playerid][Pass], 129, "%s", INI_String(file, "Password"));
format(pInfo[playerid][Breason], 300, "%s", INI_String(file, "Breason"));
pInfo[playerid][Money] = INI_Int(file, "Money");
pInfo[playerid][Scores] = INI_Int(file, "Scores",);
pInfo[playerid][Kills] = INI_Int(file, "Kills",);
pInfo[playerid][Deaths] = INI_Int(file, "Deaths",);
pInfo[playerid][Admin] = INI_Int(file, "AdminLvl",);
pInfo[playerid][Banned] = INI_Int(file, "Banned",);
return 1;
}