Raised This Month: $ Target: $400
 0% 

errors


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Miko000000
Senior Member
Join Date: Jul 2008
Location: Slovakia
Old 02-20-2009 , 14:46   errors
Reply With Quote #1

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")
}
Miko000000 is offline
Send a message via ICQ to Miko000000 Send a message via Skype™ to Miko000000
Dr.G
Senior Member
Join Date: Nov 2008
Old 02-20-2009 , 15:37   Re: errors
Reply With Quote #2

change public timing(id) to public timing() you aint using that id any where in that function
__________________
Dr.G is offline
Miko000000
Senior Member
Join Date: Jul 2008
Location: Slovakia
Old 02-20-2009 , 15:42   Re: errors
Reply With Quote #3

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)
Miko000000 is offline
Send a message via ICQ to Miko000000 Send a message via Skype™ to Miko000000
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 02-20-2009 , 15:46   Re: errors
Reply With Quote #4

how is counttovote created and where is 2997 line?
__________________
xPaw is offline
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 02-20-2009 , 15:47   Re: errors
Reply With Quote #5

show the whole code
its hard to tell when "restart" is called
__________________
minimiller is offline
Send a message via MSN to minimiller
Miko000000
Senior Member
Join Date: Jul 2008
Location: Slovakia
Old 02-20-2009 , 15:48   Re: errors
Reply With Quote #6

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
Miko000000 is offline
Send a message via ICQ to Miko000000 Send a message via Skype™ to Miko000000
Dr.G
Senior Member
Join Date: Nov 2008
Old 02-20-2009 , 15:48   Re: errors
Reply With Quote #7

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 ""
__________________
Dr.G is offline
Miko000000
Senior Member
Join Date: Jul 2008
Location: Slovakia
Old 02-20-2009 , 15:55   Re: errors
Reply With Quote #8

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()
Miko000000 is offline
Send a message via ICQ to Miko000000 Send a message via Skype™ to Miko000000
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 02-20-2009 , 15:55   Re: errors
Reply With Quote #9

o right..
PHP Code:
public timing(id)

->

public timing() 
__________________
xPaw is offline
Old 02-20-2009, 15:58
Miko000000
This message has been deleted by Miko000000.
Miko000000
Senior Member
Join Date: Jul 2008
Location: Slovakia
Old 02-20-2009 , 16:03   Re: errors
Reply With Quote #10

i dont understand it omg
Miko000000 is offline
Send a message via ICQ to Miko000000 Send a message via Skype™ to Miko000000
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 16:51.


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