Raised This Month: $ Target: $400
 0% 

delay not working, if condition too, help me =0


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Owyn
Veteran Member
Join Date: Nov 2007
Old 01-11-2009 , 19:27   delay not working, if condition too, help me =0
Reply With Quote #1

Code:
new minutes[8]

public cmdBanIP(id, level, cid)
{
    if (!cmd_access(id, level, cid, 3))
        return PLUGIN_HANDLED
    
    new target[32], reason[64]
    
    read_argv(1, target, 31)
    read_argv(2, minutes, 7)
    read_argv(3, reason, 63)
    
    new player = cmd_target(id, target, 9)
    
    if (!player)
        return PLUGIN_HANDLED
    
    new authid[32], name2[32], authid2[32], name[32]
    new userid2 = get_user_userid(player)
    
    get_user_authid(player, authid2, 31)
    get_user_authid(id, authid, 31)
    get_user_name(player, name2, 31)
    get_user_name(id, name, 31)
    
    log_amx("Ban: ^"%s<%d><%s><>^" ban and kick ^"%s<%d><%s><>^" (minutes ^"%s^") (reason ^"%s^")", name, get_user_userid(id), authid, name2, userid2, authid2, minutes, reason)

    new temp[64], banned[16], nNum = str_to_num(minutes)
    if (nNum)
        format(temp, 63, "%L", player, "FOR_MIN", minutes)
    else
        format(temp, 63, "%L", player, "PERM")
    format(banned, 15, "%L", player, "BANNED")

    new address[32]
    new hostname[64]
    get_cvar_string("hostname",hostname,63);
    get_user_ip(player, address, 31, 1)
    new target_ip[35];
    get_user_ip(player, target_ip, sizeof(target_ip) - 1, 1);
    
    console_print(player, "************************************************");
    console_print(player, "Informacia o bane");
    console_print(player, "Nick: %s", name2);
    console_print(player, "IP: %s", target_ip);
    console_print(player, "Pri4ina: %s", reason);

    set_task(5, "TaskDisconnectPlayer", player);
    
    return PLUGIN_HANDLED
}

public TaskDisconnectPlayer(client)
{

    new addr[32]
    get_user_ip(client, addr, 31, 1)

    if (minutes[0])
        server_cmd("addip 7200 ^"%s^";wait;writeip", addr)
    else
        server_cmd("addip ^"%s^" ^"%s^";wait;writeip", minutes, addr)

}
i'm modifiing standart admincmd.sma and can't get my things to work )= i want to make a delay for banning 5 sec and if admin try to ban permament it will ban for 7200 minutes. btw, it says writes to listip.cfg but that file is empty, but ban works and stored... somewhere =0
Owyn is offline
Send a message via ICQ to Owyn
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:46.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode