When kicking players ban info erase
#1

i have a question about my ban command if i add Kick(tid); so that the banned player will be kicked but it will not save these

INI_WriteInt(File,"Banned",1);
INI_WriteString(File,"BanAdmin",GetPlayerNameEx(pl ayerid));
INI_WriteString(File,"BanReason",res);
INI_WriteString(File,"IP",ip);

i tried timer but same the problem is with yini saving here is my command:

PHP Code:
CMD:ban(playerid,parmas[])
{
    new 
tid,res[125];
    if(
sscanf(parmas,"us[125]",tid,res)) SendClientMessage(playerid,-1,"/ban [id] [reason]");
    else if(
tid == INVALID_PLAYER_IDSendClientMessage(playerid,-1,"ID not connected.");
    else
    {
        new 
ip[16],str[30];
        
GetPlayerIp(tid,ip,sizeof(ip));
        new 
INI:File INI_Open(UserPath(tid));
        
INI_SetTag(File,"data");
        
INI_WriteInt(File,"Banned",1);
        
INI_WriteString(File,"BanAdmin",GetPlayerNameEx(playerid));
        
INI_WriteString(File,"BanReason",res);
        
INI_WriteString(File,"IP",ip);
        
INI_Close(File);
        
format(strsizeof(str),"banip %s"ip);
        
SendRconCommand(str);
        
SendRconCommand("reloadbans");
        
Kick(tid);
    }
    return 
1;

It works perfect without the Kick(tid);
Reply


Messages In This Thread
When kicking players ban info erase - by SalmaN97 - 03.11.2015, 22:16
Re: When kicking players ban info erase - by Vince - 03.11.2015, 22:49
Re: When kicking players ban info erase - by SalmaN97 - 03.11.2015, 23:02
Re: When kicking players ban info erase - by Abagail - 04.11.2015, 00:58

Forum Jump:


Users browsing this thread: 3 Guest(s)