BAN ini
#1

Код:
CMD:ban2(playerid, params[])
{
	new target[MAX_PLAYER_NAME], filestring[79], reason[64], playerID, playerName[MAX_PLAYER_NAME], string[144], string2[144];

	if(sscanf(params, "us[32]", playerID, reason)) return SCM(playerid, COLOR_GREY, "CMD: /ban [id] [reason]");
	format(filestring, sizeof(filestring), "/Users/%s.ini", target);
    new INI:File = INI_Open(filestring);
    INI_SetTag(File, "data");
    INI_WriteInt(File, "Banned", 1);
    INI_Close(File);
    new done[128];
    format(done, sizeof(done), "You banned %s", target);
    SendClientMessage(playerid,-1 , done);
    SetTimerEx("ZBan", 1000, false, "i", playerID);
    format(string, sizeof(string), "'%s was banned by %s.", target, playerName);
    SCMTL(COLOR_RED, string);
    SCM(playerID, -1, "Notification!");
   	format(string2,sizeof(string2),"SRW: you was banned by  %s | reason: %s",playerName,reason);
   	SCM(playerID,-1,string2);
   	format(string, sizeof(string), "'%s was banned by %s | reason: %s ", target, playerName, reason);
    SendMessageToAdmins(0xFF6347FF, string, 1);
	return 1;

}
when i ban some user he doesn't recive reason and also it does't writte into him account .ini that create new how can i make to writte into that account Banned 1
Reply
#2

pawn Код:
CMD:ban2(playerid, params[])
{
    new playerID, reason[64];
    if(sscanf(params, "us[32]", playerID, reason)) SCM(playerid, COLOR_GREY, "CMD: /ban [id] [reason]");
    else if(playerID > MAX_PLAYERS) SCM(playerid, 0xFF000000, "ID not connected.");
    else
    {
        new target[MAX_PLAYER_NAME], string[144];
        GetPlayerName(playerID,target,sizeof(target));
        format(string, 55, "/Users/%s.ini", target);
        new INI:File = INI_Open(string);
        if(File == INI_NO_FILE) SCM(playerid, 0xFF000000, "Account doesn't exists.");
        else
        {
            INI_SetTag(File, "data");
            INI_WriteInt(File, "Banned", 1);
            INI_Close(File);

            new playerName[MAX_PLAYER_NAME];
            GetPlayerName(playerid,playerName,sizeof(playerName));

            format(string, sizeof(string), "You banned %s", target);
            SendClientMessage(playerid,-1 , string);

            SetTimerEx("ZBan", 1000, false, "i", playerID);

            format(string, sizeof(string), "'%s was banned by %s.", target, playerName);
            SCMTL(COLOR_RED, string);

            SCM(playerID, -1, "Notification!");

            format(string,sizeof(string),"SRW: you was banned by  %s | reason: %s",playerName,reason);
            SCM(playerID,-1,string);

            format(string, sizeof(string), "'%s was banned by %s | reason: %s ", target, playerName, reason);
            SendMessageToAdmins(0xFF6347FF, string, 1);
        }
    }
    return 1;
}
Reply
#3

Still banned is on 0 in INI
Reply
#4

i mean in users any help?
Reply
#5

still not..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)