|
Author
|
Message
|
|
Senior Member
Join Date: Mar 2009
Location: Brasil
|

12-05-2010
, 10:14
index out of bounds
|
#1
|
Hello! I'm trying to do a kz plugin for my self, but i'm having a problem with the timer...
Quote:
public cmd_ShowTime(id) {
if (!is_user_alive(id))
return PLUGIN_HANDLED
if(!g_started[id]) {
ColorChat(id, GREEN, "[KZ] ^1MESSAGE")
return PLUGIN_HANDLED
}
if (ShowTime[id]) {
ShowTime[id] = false
ColorChat(id, GREEN, "[KZ] ^1MESSAGE")
remove_task(id+TASK_ID_SHOWTIME)
return PLUGIN_HANDLED
}
set_task(1.0, "DisplayTime", id+TASK_ID_SHOWTIME, _, _, "b")
ColorChat(id, GREEN, "[KZ] ^1MESSAGE")
return PLUGIN_CONTINUE
}
public DisplayTime(id) {
new tempo[12]
seconds2[id]++
if(seconds2[id] >= 10) {
seconds2[id] = 0
seconds1[id]++
}
if(seconds1[id] >= 6) {
seconds1[id] = 0
minutes2[id]++
}
if(minutes2[id] >= 10) {
minutes2[id] = 0
minutes1[id]++
}
formatex(tempo, 11, "%s%s:%s%s", minutes1[id], minutes2[id], seconds1[id], seconds2[id])
//The location is just for testing
set_hudmessage( 20, 40, 7, 0.9, -1.0, 0, 0.0, 2.0, 0.0, 1.0, -1);
ShowSyncHudMsg(id, tempohud, tempo)
}
|
I'm receiving the error index out of bounds...
What is happening?
Oh, and there is a better way to do what I want?
|
|
|
|