AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   set_task - symbol never used (https://forums.alliedmods.net/showthread.php?t=194415)

Garrey 08-28-2012 06:40

set_task - symbol never used
 
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? :P So.. if the player get banned then it shows his information and make a snapshots. :3:3

Caldeum 08-28-2012 07:14

Re: set_task - symbol never used
 
PHP Code:

xXx() 

PHP Code:

public xXx() 


Garrey 08-28-2012 10:42

Re: set_task - symbol never used
 
Quote:

Originally Posted by Caldeum (Post 1784897)
PHP Code:

xXx() 

PHP Code:

public xXx() 


Did You tried it? It has more errors if I add "public" there ;)

gogicaa 08-28-2012 10:59

Re: set_task - symbol never used
 
Post those errors here :3

Caldeum 08-28-2012 11:07

Re: set_task - symbol never used
 
Quote:

Originally Posted by Garrey (Post 1785053)
Did You tried it?

Post all code of plugin and i will test it.

Alka 08-28-2012 11:29

Re: set_task - symbol never used
 
Replace
Code:

set_task(3.0, "xXx");
=>
Code:

set_task(3.0, "xXx", _, reason);
And
Code:

xXx()
=>
Code:

xXx(reason[])

Garrey 08-28-2012 11:54

Re: set_task - symbol never used
 
1 Attachment(s)
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


Alka 08-28-2012 11:59

Re: set_task - symbol never used
 
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.

Garrey 08-28-2012 12:01

Re: set_task - symbol never used
 
Quote:

Originally Posted by Alka (Post 1785126)
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..?

fysiks 08-28-2012 19:08

Re: set_task - symbol never used
 
Quote:

Originally Posted by Garrey (Post 1785130)
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.


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

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