03.11.2015, 22:16
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:
It works perfect without the Kick(tid);
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_ID) SendClientMessage(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(str, sizeof(str),"banip %s", ip);
SendRconCommand(str);
SendRconCommand("reloadbans");
Kick(tid);
}
return 1;
}