AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   errors (https://forums.alliedmods.net/showthread.php?t=86087)

Miko000000 02-20-2009 14:46

errors
 
hello ehm i make a code and i donīt know where is mistake

log

Code:

L 02/20/2009 - 20:38:49: [AMXX] Displaying debug trace (plugin "hns.amxx")
L 02/20/2009 - 20:38:49: [AMXX] Run time error 4: index out of bounds
L 02/20/2009 - 20:38:49: [AMXX]    [0] hns.sma::timing (line 2996)
L 02/20/2009 - 20:40:49: Start of error session.

and my code

Code:

public restart(id)
{
    if((get_user_flags(id) & ADMIN_KICK)) {
    set_task(0.99, "timing", 459200, "", 0, "a", 10);
    set_task(10.0, "finishedrr")
    }
}

public timing(id)
{
    counttovote++;
    new speak[10][] = {"ten", "nine", "eight", "seven", "six", "five", "four", "three", "two", "one"};

    if ( counttovote > 10) {
          counttovote = 0;
          return PLUGIN_HANDLED;
    } else {
          if (counttovote > 0 && counttovote <= 10) {
              set_hudmessage(0, 222, 50, -1.0, 0.13, 0, 1.0, 0.94, 0.0, 0.0, 4);
              show_hudmessage(0, "Server sa restartne za %d ", 10 - counttovote);

              if (quiet != 1) {
                    client_cmd(0, "spk ^"fvox/%s^"", speak[0 +counttovote]);
                   
              }
          }
    }
    return PLUGIN_HANDLED;
}


public finishedrr()
{
    server_cmd("restart")
}


Dr.G 02-20-2009 15:37

Re: errors
 
change public timing(id) to public timing() you aint using that id any where in that function

Miko000000 02-20-2009 15:42

Re: errors
 
L 02/20/2009 - 21:40:24: [AMXX] Displaying debug trace (plugin "hns.amxx")
L 02/20/2009 - 21:40:24: [AMXX] Run time error 4: index out of bounds
L 02/20/2009 - 21:40:24: [AMXX] [0] hns.sma::timing (line 2997)

xPaw 02-20-2009 15:46

Re: errors
 
how is counttovote created and where is 2997 line?

minimiller 02-20-2009 15:47

Re: errors
 
show the whole code
its hard to tell when "restart" is called

Miko000000 02-20-2009 15:48

Re: errors
 
public restart(id)
{
if((get_user_flags(id) & ADMIN_KICK)) {
set_task(0.99, "timing", 459200, "", 0, "a", 10);
set_task(10.0, "finishedrr")
}
}

public timing()
{
counttovote++;
new speak[10][] = {"ten", "nine", "eight", "seven", "six", "five", "four", "three", "two", "one"};

if ( counttovote > 10) {
counttovote = 0;
return PLUGIN_HANDLED;
} else {
if (counttovote > 0 && counttovote <= 10) {
set_hudmessage(0, 222, 50, -1.0, 0.13, 0, 1.0, 0.94, 0.0, 0.0, 4);
show_hudmessage(0, "Server sa restartne za %d ", 10 - counttovote);

if (quiet != 1) {
client_cmd(0, "spk ^"fvox/%s^"", speak[0 +counttovote]);

}
}
}
return PLUGIN_HANDLED;
}


public finishedrr()
{
server_cmd("restart")
}

PROBLEM is in timing

Dr.G 02-20-2009 15:48

Re: errors
 
oh its your task thats wrong

PHP Code:

set_task Float:time, const function[], id 0parameter[]=""len 0flags[]=""repeat 

PHP Code:

set_task(0.99"timing"459200""0"a"10); 

to

PHP Code:

set_task(0.99"timing"); 

if u dont use a thing that the native set_task can hold just put a _ not ""

Miko000000 02-20-2009 15:55

Re: errors
 
L 02/20/2009 - 21:53:12: [AMXX] Displaying debug trace (plugin "hns.amxx")
L 02/20/2009 - 21:53:12: [AMXX] Run time error 4: index out of bounds
L 02/20/2009 - 21:53:12: [AMXX] [0] hns.sma::timing (line 2870)

lline 2870
public timing()

xPaw 02-20-2009 15:55

Re: errors
 
o right..
PHP Code:

public timing(id)

->

public timing() 


Miko000000 02-20-2009 16:03

Re: errors
 
i dont understand it omg


All times are GMT -4. The time now is 16:51.

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