Raised This Month: $ Target: $400
 0% 

index out of bounds


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
fmfs10
Senior Member
Join Date: Mar 2009
Location: Brasil
Old 12-05-2010 , 10:14   index out of bounds
Reply With Quote #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?
fmfs10 is offline
 



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 11:28.


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