please help me on this code:
Code:
public Timer_BanUserByIP(Timer,Repeat,HLUserName,HLParam)
{
new user[MAX_NAME_LENGTH];
convert_string(HLParam, user, MAX_NAME_LENGTH);
execclient(user, "snapshot");
ban(user, 0, bBanByIP);
}
public Timer_BanUserByID(Timer,Repeat,HLUserName,HLParam)
{
new user[MAX_NAME_LENGTH];
convert_string(HLParam, user, MAX_NAME_LENGTH);
execclient(user, "snapshot");
ban(user, 0, bBanByID);
}
/* admin_ban <target or WONID or IP> [<minutes>] ['ip']
admin_banip <target or WONID or IP> [<minutes>] */
public admin_ban(HLCommand,HLData,HLUserName,UserIndex) {
new ban_user[MAX_DATA_LENGTH];
new BanTime = 0;
new iBanType = bBanByID;
new Command[MAX_COMMAND_LENGTH];
new Data[MAX_DATA_LENGTH];
new strTime[MAX_NUMBER_LENGTH];
new strType[MAX_NAME_LENGTH];
new Text[MAX_TEXT_LENGTH];
new TargetName[MAX_NAME_LENGTH];
new User[MAX_NAME_LENGTH];
new THour[MAX_DATA_LENGTH];
new TMinute[MAX_DATA_LENGTH];
new TValue[MAX_DATA_LENGTH];
new TWDay[MAX_DATA_LENGTH];
new TMonth[MAX_DATA_LENGTH];
new TDay[MAX_DATA_LENGTH];
new TYear[MAX_DATA_LENGTH];
servertime(THour, MAX_DATA_LENGTH, "%I");
servertime(TMinute, MAX_DATA_LENGTH, "%M");
servertime(TValue, MAX_DATA_LENGTH, "%p");
servertime(TWDay, MAX_DATA_LENGTH, "%A");
servertime(TMonth, MAX_DATA_LENGTH, "%B");
servertime(TDay, MAX_DATA_LENGTH, "%d");
servertime(TYear, MAX_DATA_LENGTH, "%Y");
convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
convert_string(HLData,Data,MAX_DATA_LENGTH);
convert_string(HLUserName,User,MAX_NAME_LENGTH);
strbreak(Data,ban_user,strTime, MAX_DATA_LENGTH);
strbreak(strTime, strTime, strType, MAX_DATA_LENGTH);
if(strlen(strTime) != 0) BanTime = strtonum(strTime);
if((strcasecmp(strType, "ip")==0) || (getvar("sv_lan") != 0) || (strcasecmp(Command, "admin_banip")==0)) iBanType = bBanByIP;
if (check_user(ban_user)==1) {
get_username(ban_user,TargetName,MAX_NAME_LENGTH);
say_command(User,Command,TargetName);
if(check_immunity(ban_user)==1) {
snprintf(Text, MAX_TEXT_LENGTH, "Laf. You can't ban '%s', you silly bear.", TargetName);
messageex(TargetName,Text,print_chat);
} else {
snprintf(Text, MAX_TEXT_LENGTH, "[ADMIN] Screenshot was taken on : ", TargetName);
messageex(ban_user,Text,print_chat);
snprintf(Text, MAX_TEXT_LENGTH, "[ADMIN] Date: %s:%s%s %s %s %s", THour, TMinute, TValue, TDay, TMonth, TYear);
messageex(ban_user,Text,print_chat);
snprintf(Text, MAX_TEXT_LENGTH, "For unban go here :",TargetName);
messageex(ban_user,Text,print_console);
if (iBanType == bBanByIP)
{
set_timer("Timer_BanUserByIP", 1, 0, ban_user);
} else if (iBanType == bBanByID) {
set_timer("Timer_BanUserByID", 1, 0, ban_user);
}
}
} else {
say_command(User,Command,ban_user);
ban(ban_user,BanTime,iBanType);
}
return PLUGIN_HANDLED;
}
I want to add a new message on chat : I want to print user's ip on chat message (snprintf .... IP : )
I tryed to add, compiler works but when i use command on a user give me dont send. So make it correctly please