capitanazop Posted March 30, 2009 Posted March 30, 2009 hi, i have a problem with getTickCount in script of my friend, any alternative to this function? bye
Extremo Posted March 30, 2009 Posted March 30, 2009 Maybe posting the problem would be better then searching for a alternative. I don't think that theres much of a alternative doing the same then GetTickCount. Unless you want to make a timer and adjust a local value all the time, i dont think so.
capitanazop Posted March 30, 2009 Author Posted March 30, 2009 the gettickcount function doesnt work, the mta server dont run the gamemode.
darkdreamingdan Posted March 30, 2009 Posted March 30, 2009 Yeah, its an MTA bug (resolved in 1.0). You could try something like getRealTime and get the seconds.
Ryder! Posted March 31, 2009 Posted March 31, 2009 (edited) we have this Server -- somewhere in the code... triggerClientEvent( client, "model_select", getRootElement(), skinModels ) --skinModels is a table Client function start_selection( tModels ) models = tModels --[[ .... some code .... ]] spawn() end function spawn() --math.randomseed( getTickCount() ) local model_id = math.random( 1, #models ) --[[ .... some code .... ]] end addEvent( "model_select", true ) addEventHandler( "model_select", getRootElement(), start_selection ) (just in case, the table models is correct, the problem is not with the table ) if i enter the server for first time, model_id will return 1. So i have to reconnect and the script will run correctly with no errors and model_id will return a correct random number. So i asked in irc and somebody told me to put math.randomseed( getTickCount() ) before generating the random number (model_id) and it worked perfectly. But later in newer nightlies this problem came back and the script wont work at all. So after doing some outputChatBox( getTickCount() ) i realized that it returned always 0 Right now im using r562 Edited April 2, 2009 by Guest
darkdreamingdan Posted April 2, 2009 Posted April 2, 2009 If you can reproduce this reliably please report this on our bugtracker.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now