Raised This Month: $ Target: $400
 0% 

crashing error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 07-15-2006 , 01:01   crashing error
Reply With Quote #1

while playing my game, i wait for 12 secs for the special effects and crap to happen but when it does. It crashes the game with no error messages...

Code:
public lighting(id) {     client_cmd(0, "spk ambience/thunder_clap.wav")     message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, id)     write_short(1<<10)     write_short(1<<10)     write_short(0x0000)     write_byte(0)     write_byte(255)     write_byte(255)     write_byte(255)     message_end() } public admin_dark(id, level, cid) {     if (!cmd_access(id, level, cid, 2))         return PLUGIN_HANDLED         new arg[32]     read_argv(1,arg,31);     if(arg[0] == '1')     {           set_hudmessage(0, 255, 0, -1.0, 0.2, 0, 6.0, 4.0)         show_hudmessage(0, "Night Hour ENABLED")         set_lights("aaaaaaaaaaabbbbbaaa")         set_task(12.0, "lighting", 0, _, _, "b")         client_cmd(0, "spk ambience/wolfhowl01.wav")     }         else if(arg[0] == '0')     {         set_hudmessage(0, 255, 0, -1.0, 0.2, 0, 6.0, 4.0)         show_hudmessage(0, "Night Hour DISABLED")         set_lights("#OFF")     }     return PLUGIN_HANDLED }
but when i took out the screenfade part, everything works pefectly BUT when i set things back to normal
i can still hear the thunder every 12 secs
__________________
It's a mystery.
Mini_Midget is offline
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 07-16-2006 , 06:55   Re: crashing error
Reply With Quote #2

Code:
set_task(12.0, "lighting", 0, _, _, "b") .. message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, id)
theres no id passed into the function

try this
Code:
message_begin(MSG_BROADCAST, get_user_msgid("ScreenFade"))
__________________
plop
p3tsin is offline
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 07-17-2006 , 03:27   Re: crashing error
Reply With Quote #3

sweet as
works now but i still have that error where when i disable night hour,
i can still hear and see the white screenfade every 12 seconds which really bugs when cause it doesn't suit it when its in day time
__________________
It's a mystery.
Mini_Midget is offline
TheNewt
Donor
Join Date: Jun 2006
Location: Where I live.
Old 07-17-2006 , 14:07   Re: crashing error
Reply With Quote #4

Maybe cuase when you turn on the nightmode thing, it sets the task to run infinite amount of times, which includes even after you turn it off. I'd say have the task set up another function that checks whether its night or day
oh and put the set_task into the public plugin_init().
Add also a global variable that holds whether its night or day, like I don't know, 1 is night 0 is day?

So I unno like
Code:
bool:g_Night // False = Day || True = Night public plugin_init() {     register_plugin(PLUGIN,VERSION,AUTHOR)     set_task(12.0, "CheckTime", id, _, _, "b") } public CheckTime(id) {     if(!g_Night) {         set_hudmessage(0, 255, 0, -1.0, 0.2, 0, 6.0, 4.0)         show_hudmessage(0, "Night Hour DISABLED")         set_lights("#OFF")     }     else {         set_hudmessage(0, 255, 0, -1.0, 0.2, 0, 6.0, 4.0)         show_hudmessage(0, "Night Hour ENABLED")         set_lights("aaaaaaaaaaabbbbbaaa")         lightning(id)         client_cmd(0, "spk ambience/wolfhowl01.wav")     } }
something like that you know?
__________________
Quote:
toe3_ left the chat room. (G-lined (AUTO Excessive connections from a single host.))
TheNewt is offline
Reply


Thread Tools
Display Modes

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 08:07.


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