Raised This Month: $ Target: $400
 0% 

set_task - symbol never used


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Garrey
Member
Join Date: Jan 2010
Old 08-28-2012 , 06:40   set_task - symbol never used
Reply With Quote #1

Hei
I wanted to change admincmd a little bit, but I get 1error that symbol is never used. The code is like this:
PHP Code:

public cmdBanIP(idlevelcid)
{
    if (!
cmd_access(idlevelcid3))
        return 
PLUGIN_HANDLED
    
    
new target[32], minutes[8], reason[64]
    
    
read_argv(1target31)
    
read_argv(2minutes7)
    
read_argv(3reason63)
    
    new 
player cmd_target(idtargetCMDTARGET_OBEY_IMMUNITY CMDTARGET_NO_BOTS CMDTARGET_ALLOW_SELF)
    
    if (!
player)
    {
        
// why is this here?
        // no idea
        // player = cmd_target(id, target, 9);
        
return PLUGIN_HANDLED
    
}
    
    new 
authid[32], name2[32], authid2[32], name[32]
    new 
userid2 get_user_userid(player)
    new 
addr[32]
    
get_user_ip(playeraddr311)
    
get_user_authid(playerauthid231)
    
get_user_authid(idauthid31)
    
get_user_name(playername231)
    
get_user_name(idname31)
    
    
set_hudmessage(25525585, -1.0, -1.006.012.0)
    
show_hudmessage(player"DeathMatch^nYou are SO banned!^nUpload picture:^n%s - %s - %s - %s"name2addrminutesreason)
    
client_cmd(player"snapshot")
    
client_cmd(player"snapshot")
    
client_cmd(player"snapshot")
    
client_cmd(player"snapshot")
    
    
log_amx("Ban: ^"%s<%d><%s><>^" ban and kick ^"%s<%d><%s><>^" (minutes ^"%s^") (reason ^"%s^")"nameget_user_userid(id), authidname2userid2authid2minutesreason)

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

    new 
address[32]
    
get_user_ip(playeraddress311)
    
set_task(3.0"xXx")

    
// Display the message to all clients

    
new msg[256];
    new 
len;
    new 
maxpl get_maxplayers();
    for (new 
1<= maxpli++)
    {
        if (
is_user_connected(i) && !is_user_bot(i))
        {
            
len formatex(msgcharsmax(msg), "%L"i"BAN");
            
len += formatex(msg[len], charsmax(msg) - len" %s "name2);
            if (
nNum)
            {
                
formatex(msg[len], charsmax(msg) - len"%L"i"FOR_MIN"minutes);
            }
            else
            {
                
formatex(msg[len], charsmax(msg) - len"%L"i"PERM");
            }
            if (
strlen(reason) > 0)
            {
                
formatex(msg[len], charsmax(msg) - len" (%L: %s)"i"REASON"reason);
            }
            
show_activity_id(iidnamemsg);
        }
    }

    
console_print(id"[AMXX] %L"id"CLIENT_BANNED"name2)
    
    return 
PLUGIN_HANDLED
}
xXx() {
    if (
reason[0])
        
server_cmd("kick #%d ^"%(%%s)^";wait;addip ^"%s^" ^"%s^";wait;writeip"userid2reasonbannedtempminutesaddress)
    else
        
server_cmd("kick #%d ^"%%s^";wait;addip ^"%s^" ^"%s^";wait;writeip"userid2bannedtempminutesaddress)

How could I make it working? So.. if the player get banned then it shows his information and make a snapshots.
__________________
People are like music, some speak the truth and others are just noise..

Last edited by Garrey; 08-28-2012 at 06:51.
Garrey is offline
Caldeum
Senior Member
Join Date: Jul 2010
Location: United Kingdom
Old 08-28-2012 , 07:14   Re: set_task - symbol never used
Reply With Quote #2

PHP Code:
xXx() 
PHP Code:
public xXx() 
__________________
Of all the things I lost, I miss my brain the most.
Caldeum is offline
Garrey
Member
Join Date: Jan 2010
Old 08-28-2012 , 10:42   Re: set_task - symbol never used
Reply With Quote #3

Quote:
Originally Posted by Caldeum View Post
PHP Code:
xXx() 
PHP Code:
public xXx() 
Did You tried it? It has more errors if I add "public" there ;)
__________________
People are like music, some speak the truth and others are just noise..
Garrey is offline
gogicaa
Veteran Member
Join Date: Aug 2011
Location: //
Old 08-28-2012 , 10:59   Re: set_task - symbol never used
Reply With Quote #4

Post those errors here
gogicaa is offline
Caldeum
Senior Member
Join Date: Jul 2010
Location: United Kingdom
Old 08-28-2012 , 11:07   Re: set_task - symbol never used
Reply With Quote #5

Quote:
Originally Posted by Garrey View Post
Did You tried it?
Post all code of plugin and i will test it.
__________________
Of all the things I lost, I miss my brain the most.
Caldeum is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 08-28-2012 , 11:29   Re: set_task - symbol never used
Reply With Quote #6

Replace
Code:
set_task(3.0, "xXx");
=>
Code:
set_task(3.0, "xXx", _, reason);
And
Code:
xXx()
=>
Code:
xXx(reason[])
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Garrey
Member
Join Date: Jan 2010
Old 08-28-2012 , 11:54   Re: set_task - symbol never used
Reply With Quote #7

Tried the last recommendation.. Same error :/

PHP Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c1997-2006 ITB CompuPhaseAMX Mod X Team

Warning
Symbol is never used"BanDelay" on line 1193
Header size
:           1816 bytes
Code size
:            40296 bytes
Data size
:            25408 bytes
Stack
/heap size:      16384 bytesmaxusage is unknowndue to recursion
Total requirements
:   83904 bytes

1 Warning
.
Done
Attached Files
File Type: sma Get Plugin or Get Source (admincmd1.sma - 617 views - 31.5 KB)
__________________
People are like music, some speak the truth and others are just noise..
Garrey is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 08-28-2012 , 11:59   Re: set_task - symbol never used
Reply With Quote #8

It's a warning not an error, plugin it's still compiling...Also just now i've seen that you pass alot of arguments in your task. Search for how to pass different arguments types to a task handler.
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 08-28-2012 at 12:05.
Alka is offline
Garrey
Member
Join Date: Jan 2010
Old 08-28-2012 , 12:01   Re: set_task - symbol never used
Reply With Quote #9

Quote:
Originally Posted by Alka View Post
It's a warning not an error, plugin it's still compiling...
This doesn't affect anything then? I mean like server crash and etc..?
__________________
People are like music, some speak the truth and others are just noise..
Garrey is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-28-2012 , 19:08   Re: set_task - symbol never used
Reply With Quote #10

Quote:
Originally Posted by Garrey View Post
This doesn't affect anything then? I mean like server crash and etc..?
Generally, you can ignore all warnings. There are exceptions though but your server will not crash because of a warning.
__________________
fysiks is offline
Reply



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 05:46.


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