novo Posted December 8, 2011 Posted December 8, 2011 Hi all. I found a script for matrix camera on countdown. I don't know why it's not working, please help me: Client-side: (countC.lua) ------------------------------------------------------------------------ --Copyright ©, Jesseunit --Please, do not Re-distribute ------------------------------------------------------------------------- local start = getTickCount(); local duration = 5000; local screenWidth, screenHeight = guiGetScreenSize(); local font = "bankgothic"; local scale = 2; local jij = getLocalPlayer() countMsg = { "Get ready for the countdown..." } local text = countMsg[#countMsg]; function addText(text) table.insert(countMsg, text) end addEvent("addTextdoor", true) addEventHandler("addTextdoor", root, function(text) addText(text) end ) function countRender() if stoprender == false then if not tickcount then tickcount = getTickCount () end if not alpha then alpha = 255 end local seconds = getTickCount() - tickcount alpha = alpha - (seconds / 200) alpha2 = alpha - 105 if alpha2 <= 0 then alpha2 = 0 end if alpha <= 0 then removeEventHandler("onClientRender", getRootElement(), countRender) alpha = 0 end else alpha2 = 150 alpha = 255 end local now = getTickCount() local time = now - start local width = dxGetTextWidth(text, scale, font) dxDrawRectangle(0, screenHeight-400.0, screenWidth, 50, tocolor(0, 0, 0, alpha2 or 150)) if (time > duration) then start = now text = countMsg[math.random(1, #countMsg)] return end local modi = duration - time dxDrawText(text, math.mod(modi, duration) / duration * (screenWidth + width) - width, screenHeight-408.0, 0, 0, tocolor(0, 161, 255, alpha or 255), scale, font) end function onClientRaceStateChanging ( newStateName, oldStateName) if oldStateName == "PreGridCountdown" then stoprender = true addEventHandler("onClientRender", getRootElement(), countRender) end if newStateName == "GridCountdown" then setTimer(function() stoprender = false end, 3500, 1) local x,y,z = getElementPosition(getPedOccupiedVehicle(jij)) timer1 = setTimer(setCameraMatrix, 6000, 1, x + 1, y + 4, z + 2, x, y, z, 10, 0) timer2 = setTimer(setCameraMatrix, 7000, 1, x + 5, y - 4, z + 4, x, y, z, 55, 0) timer3 = setTimer(setCameraMatrix, 8000, 1, x - 3, y + 5, z + 3, x, y, z, 21, 0) end if newStateName == "Running" then setCameraTarget(jij) end end addEvent( "onPlayersReady", true ) addEventHandler( "onPlayersReady", getRootElement(), onClientRaceStateChanging ) function restartMap() killTimer(timer1) killTimer(timer2) killTimer(timer3) end addCommandHandler("redo",restartMap) Server-side: (countS.lua) addEvent("onRaceStateChanging", true) addEventHandler("onRaceStateChanging", getRootElement(), function(newStateName, oldStateName) triggerClientEvent ( "onPlayersReady", getRootElement(), newStateName, oldStateName) end) Meta.xml: <meta> <info author="Jesseunit" version="1" type="script" /> <script src="countC.lua" type="client" /> <script src="counts.lua" type="server" /> </meta> Please help. Thanks <3
Castillo Posted December 8, 2011 Posted December 8, 2011 ------------------------------------------------------------------------ --Copyright ©, Jesseunit --Please, do not Re-distribute ------------------------------------------------------------------------- local start = getTickCount(); local duration = 5000; local screenWidth, screenHeight = guiGetScreenSize(); local font = "bankgothic"; local scale = 2; local jij = getLocalPlayer() countMsg = { "Get ready for the countdown..." } local text = countMsg[#countMsg]; function addText(text) table.insert(countMsg, text) end addEvent("addTextdoor", true) addEventHandler("addTextdoor", root, function(text) addText(text) end ) function countRender() if stoprender == false then if not tickcount then tickcount = getTickCount () end if not alpha then alpha = 255 end local seconds = getTickCount() - tickcount alpha = alpha - (seconds / 200) alpha2 = alpha - 105 if alpha2 <= 0 then alpha2 = 0 end if alpha <= 0 then removeEventHandler("onClientRender", getRootElement(), countRender) alpha = 0 end else alpha2 = 150 alpha = 255 end local now = getTickCount() local time = now - start local width = dxGetTextWidth(text, scale, font) dxDrawRectangle(0, screenHeight-400.0, screenWidth, 50, tocolor(0, 0, 0, alpha2 or 150)) if (time > duration) then start = now text = countMsg[math.random(1, #countMsg)] return end local modi = duration - time dxDrawText(text, math.mod(modi, duration) / duration * (screenWidth + width) - width, screenHeight-408.0, 0, 0, tocolor(0, 161, 255, alpha or 255), scale, font) end function onClientRaceStateChanging ( newStateName, oldStateName) if oldStateName == "PreGridCountdown" then stoprender = true addEventHandler("onClientRender", getRootElement(), countRender) end if newStateName == "GridCountdown" then setTimer(function() stoprender = false end, 3500, 1) local x,y,z = getElementPosition(getPedOccupiedVehicle(jij)) timer1 = setTimer(setCameraMatrix, 6000, 1, x + 1, y + 4, z + 2, x, y, z, 10, 0) timer2 = setTimer(setCameraMatrix, 7000, 1, x + 5, y - 4, z + 4, x, y, z, 55, 0) timer3 = setTimer(setCameraMatrix, 8000, 1, x - 3, y + 5, z + 3, x, y, z, 21, 0) timer4 = setTimer(setCameraTarget, 9000, 1, jij) end if newStateName == "Running" then setCameraTarget(jij) end end addEvent( "onPlayersReady", true ) addEventHandler( "onPlayersReady", getRootElement(), onClientRaceStateChanging ) function restartMap() killTimer(timer1) killTimer(timer2) killTimer(timer3) end addCommandHandler("redo",restartMap)
Aibo Posted December 8, 2011 Posted December 8, 2011 i wonder, why noone cares about: --Copyright ©, Jesseunit --Please, do not Re-distribute
Xeno Posted December 8, 2011 Posted December 8, 2011 i wonder, why noone cares about:--Copyright ©, Jesseunit --Please, do not Re-distribute Exactly what I was thinking..
BinSlayer1 Posted December 9, 2011 Posted December 9, 2011 You know, we don't help to stealers novo. Novo has already been helped. Your post is irrelevant.. I guess it's a +1 for your total count..
CapY Posted December 9, 2011 Posted December 9, 2011 You know, we don't help to stealers novo. Novo has already been helped. Your post is irrelevant.. I guess it's a +1 for your total count.. I most of the times never read the full topic.
NotAvailable Posted December 9, 2011 Posted December 9, 2011 I don't see why people help script stealers... But yeah, NVM.
12p Posted December 9, 2011 Posted December 9, 2011 I don't see why people help script stealers... But yeah, NVM. Look at me. I could have helped but I didn't. Castillo did.
NotAvailable Posted December 9, 2011 Posted December 9, 2011 Could a Moderator/S-mod remove this script please? This is a private script.
NotAvailable Posted December 9, 2011 Posted December 9, 2011 Jesseunit, you can ask mod/smod in IRC. Oh right... thanks
Castillo Posted December 9, 2011 Posted December 9, 2011 I don't see why people help script stealers... But yeah, NVM. When I see that is a stolen script, I don't help them, but I couldn't know, maybe it was a resource from the MTA community and he was just editing it, I can't download every resource and compare them .
Cadu12 Posted December 9, 2011 Posted December 9, 2011 (edited) Solidsnake14, you can read other topics: viewtopic.php?f=91&t=36413 <-- VIP donate from SHC viewtopic.php?f=91&t=37622 <-- Stole client-side and he wants decompile viewtopic.php?f=91&t=37610&p=387607#p387607 <-- from SHC viewtopic.php?f=91&t=37526 <-- I dont know His english is sucks and scripts english clear are good. Thats he stole at all Edited December 9, 2011 by Guest
AGENT_STEELMEAT Posted December 9, 2011 Posted December 9, 2011 I most of the times never read the full topic. That is why nobody loves you.
CapY Posted December 9, 2011 Posted December 9, 2011 That is why nobody loves you. Only you honey. You are the only one who thinks that
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