Mbtdaa Posted March 18, 2014 Share Posted March 18, 2014 hi i want to do misshontimer om my map i type in server side function timersetup() MissionTimer = exports.missiontimer:createMissionTimer (timersetup,true,"%m:%s",0.5,0.08,true,"default-bold",1,255,255,255) triggerClientEvent ( "setupNewMissionTimer", element, duration, countdown, timerFormat, x, y, bg, font, scale, r, g, b,timersetup ) triggerClientEvent ( "setMissionTimerRemainingTime", timer, time,timersetup ) triggerClientEvent ( "setMissionTimerFrozen", timer, frozen,timersetup ) triggerClientEvent ( "setMissionTimerHurryTime", timer, time,timersetup ) triggerClientEvent ( "setMissionTimerFormat", timer, timerFormat,timersetup ) triggerClientEvent ( source, "setupNewMissionTimer", timer, getMissionTimerTime(timer), data.countdown, data.timerFormat, data.x, data.y, data.bg, data.font, data.scale, data.r, data.g, data.b,timersetup ) end client side addEvent ( "setupNewMissionTimer", true ) addEventHandler ( "setupNewMissionTimer", rootElement, function(duration, countdown, timerFormat, x, y, bg, font, scale, r, g, b ) setupMissionTimer ( source, duration, countdown, timerFormat, x, y, bg, font, scale, r, g, b ) end ) addEvent ( "setMissionTimerRemainingTime", true ) addEventHandler ( "setMissionTimerRemainingTime", rootElement, function(remaining) setMissionTimerTime ( source, remaining ) end ) addEvent ( "setMissionTimerFrozen", true ) addEventHandler ( "setMissionTimerFrozen", rootElement, function(frozen) setMissionTimerFrozen ( source, frozen ) end ) addEvent ( "setMissionTimerHurryTime", true ) addEventHandler ( "setMissionTimerHurryTime", rootElement, function(time) setMissionTimerHurryTime ( source, time ) end ) addEvent ( "setMissionTimerFormat", true ) addEventHandler ( "setMissionTimerFormat", rootElement, function(timerFormat) setMissionTimerFormat ( source, timerFormat ) end ) debugscript say Warinig:client:2:bad argument @ 'addEventHandler'[Expected element as arument 2,got nil] Warinig:client:9:bad argument @ 'addEventHandler'[Expected element as arument 2,got nil] Warinig:client:16:bad argument @ 'addEventHandler'[Expected element as arument 2,got nil] Warinig:client:23:bad argument @ 'addEventHandler'[Expected element as arument 2,got nil] Warinig:client:31:bad argument @ 'addEventHandler'[Expected element as arument 2,got nil] Link to comment
Anubhav Posted March 18, 2014 Share Posted March 18, 2014 addEvent ( "setupNewMissionTimer", true ) addEventHandler ( "setupNewMissionTimer", root, function(duration, countdown, timerFormat, x, y, bg, font, scale, r, g, b ) setupMissionTimer ( source, duration, countdown, timerFormat, x, y, bg, font, scale, r, g, b ) end ) addEvent ( "setMissionTimerRemainingTime", true ) addEventHandler ( "setMissionTimerRemainingTime", root, function(remaining) setMissionTimerTime ( source, remaining ) end ) addEvent ( "setMissionTimerFrozen", true ) addEventHandler ( "setMissionTimerFrozen", root, function(frozen) setMissionTimerFrozen ( source, frozen ) end ) addEvent ( "setMissionTimerHurryTime", true ) addEventHandler ( "setMissionTimerHurryTime", root, function(time) setMissionTimerHurryTime ( source, time ) end ) addEvent ( "setMissionTimerFormat", true ) addEventHandler ( "setMissionTimerFormat", root, function(timerFormat) setMissionTimerFormat ( source, timerFormat ) end ) Link to comment
Mbtdaa Posted March 18, 2014 Author Share Posted March 18, 2014 addEvent ( "setupNewMissionTimer", true ) addEventHandler ( "setupNewMissionTimer", root, function(duration, countdown, timerFormat, x, y, bg, font, scale, r, g, b ) setupMissionTimer ( source, duration, countdown, timerFormat, x, y, bg, font, scale, r, g, b ) end ) addEvent ( "setMissionTimerRemainingTime", true ) addEventHandler ( "setMissionTimerRemainingTime", root, function(remaining) setMissionTimerTime ( source, remaining ) end ) addEvent ( "setMissionTimerFrozen", true ) addEventHandler ( "setMissionTimerFrozen", root, function(frozen) setMissionTimerFrozen ( source, frozen ) end ) addEvent ( "setMissionTimerHurryTime", true ) addEventHandler ( "setMissionTimerHurryTime", root, function(time) setMissionTimerHurryTime ( source, time ) end ) addEvent ( "setMissionTimerFormat", true ) addEventHandler ( "setMissionTimerFormat", root, function(timerFormat) setMissionTimerFormat ( source, timerFormat ) end ) No problem in debugscript but the time no't showing Link to comment
Anubhav Posted March 18, 2014 Share Posted March 18, 2014 Are you sure mission time is started? And.. You must use exports.missiontimer:setMissionTimerFrozen or blabla. Link to comment
Mbtdaa Posted March 18, 2014 Author Share Posted March 18, 2014 Are you sure mission time is started? And.. You must use exports.missiontimer:setMissionTimerFrozen or blabla. you meen like that function timersetup() MissionTimer = exports.missiontimer:createMissionTimer (timersetup,true,"%m:%s",0.5,0.08,true,"default-bold",1,255,255,255) frozen = exports.missiontimer:setMissionTimerFrozen(timersetup,true) RemainingTime = exports.missiontimer:setMissionTimerRemainingTime(timersetup,true) setMissionTimerHurryTime = exports.missiontimer:setMissionTimerHurryTime(timersetup,true) setMissionTimerFormat = exports.missiontimer:setMissionTimerFormat(timersetup,true) triggerClientEvent ( "setupNewMissionTimer", element, duration, countdown, timerFormat, x, y, bg, font, scale, r, g, b,timersetup ) triggerClientEvent ( "setMissionTimerRemainingTime", timer, time,timersetup ) triggerClientEvent ( "setMissionTimerFrozen", timer, frozen,timersetup ) triggerClientEvent ( "setMissionTimerHurryTime", timer, time,timersetup ) triggerClientEvent ( "setMissionTimerFormat", timer, timerFormat,timersetup ) triggerClientEvent ( source, "setupNewMissionTimer", timer, getMissionTimerTime(timer), data.countdown, data.timerFormat, data.x, data.y, data.bg, data.font, data.scale, data.r, data.g, data.b,timersetup ) end ? Link to comment
Anubhav Posted March 18, 2014 Share Posted March 18, 2014 Ye. You missed one in triggerClientEvent ( source, "setNewMissionTimer") And the second argument of triggerClientEvent should be root. Link to comment
Mbtdaa Posted March 18, 2014 Author Share Posted March 18, 2014 Ye. You missed one in triggerClientEvent ( source, "setNewMissionTimer")And the second argument of triggerClientEvent should be root. function timersetup() MissionTimer = exports.missiontimer:createMissionTimer (timersetup,true,"%m:%s",0.5,0.08,true,"default-bold",1,255,255,255) frozen = exports.missiontimer:setMissionTimerFrozen(timersetup,true) RemainingTime = exports.missiontimer:setMissionTimerRemainingTime(timersetup,true) setMissionTimerHurryTime = exports.missiontimer:setMissionTimerHurryTime(timersetup,true) setMissionTimerFormat = exports.missiontimer:setMissionTimerFormat(timersetup,true) triggerClientEvent ( root,"setupNewMissionTimer", timer, getMissionTimerTime(timer), data.countdown, data.timerFormat, data.x, data.y, data.bg, data.font, data.scale, data.r, data.g, data.b,timersetup ) triggerClientEvent ( root,"setMissionTimerRemainingTime", timer, time,timersetup ) triggerClientEvent ( root,"setMissionTimerFrozen", timer, frozen,timersetup ) triggerClientEvent ( root,"setMissionTimerHurryTime", timer, time,timersetup ) triggerClientEvent ( root,"setMissionTimerFormat", timer, timerFormat,timersetup ) end Link to comment
Anubhav Posted March 18, 2014 Share Posted March 18, 2014 Hmm sorry i edited the post i will give you the code. function timersetup() MissionTimer = exports.missiontimer:createMissionTimer (timersetup,true,"%m:%s",0.5,0.08,true,"default-bold",1,255,255,255) frozen = exports.missiontimer:setMissionTimerFrozen(timersetup,true) RemainingTime = exports.missiontimer:setMissionTimerRemainingTime(timersetup,true) setMissionTimerHurryTime = exports.missiontimer:setMissionTimerHurryTime(timersetup,true) setMissionTimerFormat = exports.missiontimer:setMissionTimerFormat(timersetup,true) triggerClientEvent ( "setupNewMissionTimer",root, timer, getMissionTimerTime(timer), data.countdown, data.timerFormat, data.x, data.y, data.bg, data.font, data.scale, data.r, data.g, data.b,timersetup ) triggerClientEvent ( "setMissionTimerRemainingTime",root, timer, time,timersetup ) triggerClientEvent ( "setMissionTimerFrozen",root, timer, frozen,timersetup ) triggerClientEvent ( "setMissionTimerHurryTime", timer, time,timersetup ) triggerClientEvent ( "setMissionTimerFormat",root, timer, timerFormat,timersetup ) end Link to comment
Mbtdaa Posted March 18, 2014 Author Share Posted March 18, 2014 Hmm sorry i edited the post i will give you the code. function timersetup() MissionTimer = exports.missiontimer:createMissionTimer (timersetup,true,"%m:%s",0.5,0.08,true,"default-bold",1,255,255,255) frozen = exports.missiontimer:setMissionTimerFrozen(timersetup,true) RemainingTime = exports.missiontimer:setMissionTimerRemainingTime(timersetup,true) setMissionTimerHurryTime = exports.missiontimer:setMissionTimerHurryTime(timersetup,true) setMissionTimerFormat = exports.missiontimer:setMissionTimerFormat(timersetup,true) triggerClientEvent ( "setupNewMissionTimer",root, timer, getMissionTimerTime(timer), data.countdown, data.timerFormat, data.x, data.y, data.bg, data.font, data.scale, data.r, data.g, data.b,timersetup ) triggerClientEvent ( "setMissionTimerRemainingTime",root, timer, time,timersetup ) triggerClientEvent ( "setMissionTimerFrozen",root, timer, frozen,timersetup ) triggerClientEvent ( "setMissionTimerHurryTime", timer, time,timersetup ) triggerClientEvent ( "setMissionTimerFormat",root, timer, timerFormat,timersetup ) end np same problem man no't showing the time Link to comment
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