Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Lua sleep()
Re: Lua sleep() [message #450344 is a reply to message #450306] Sat, 30 July 2011 12:14 Go to previous messageGo to previous message
iRANian is currently offline  iRANian
Messages: 4308
Registered: April 2011
Karma:
General (4 Stars)
What do your debug messages say about the Jukebox script?

If you play music when a guy types "!music on" you're getting timing errors with when the script starts playing music. What you can do is play something short and repetitive with "!music on" and have the script execute the "no music" command before playing new music.

Add some debug messages to Timer_Expired() and you'll see what the correct order is, that order should be fine though.

int LuaScriptManager::Lua_Start_Timer_Wrap(lua_State *L)
{
	int argc = lua_gettop(L);
	if(argc < 4)
	{
		return 0;
	}
	int scriptID = (int)lua_tonumber(L, 1);
	int obj = (int)lua_tonumber(L, 2);
	float Time = (float)lua_tonumber(L, 3);
	int Number = (int)lua_tonumber(L, 4);
	LuaScriptManager::Lua_Start_Timer(Commands->Find_Object(obj), scriptID, Time, Number);
	return 0;
}


Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Lua. Answers.
Next Topic: What's the TFD Renegade registry path?
Goto Forum:
  


Current Time: Fri Dec 20 13:25:58 MST 2024

Total time taken to generate the page: 0.02738 seconds