manve1 Posted December 8, 2012 Posted December 8, 2012 I got a problem when i try to get marker color for an output message local topdeck = createMarker( 170, 255, 9.5, 'cylinder', 2.0, 255, 255, 255, 100 ) addEvent('changecolor1topdeck', true) addEventHandler('changecolor1topdeck', getRootElement( ), function( ) if ( getElementType ( source ) == "player" ) then local nR, nG, nB = getTeamColor( getPlayerTeam( source ) ) setMarkerColor( topdeck, nR, nG, nB, 100 ) end end ) function nana() local r1, g1, b1, a1 = getMarkerColor( topdeck ) if ( r1 == 0 and g1 == 255 and b1 == 0 ) then outputChatBox( '#FF0000[iNFO]: LOL Fail.', root, 255, 255, 255, true ) end end Looking for tutorials or information? check out: www.simpleask.co.uk
Hexa Posted December 8, 2012 Posted December 8, 2012 (edited) Did you try debugscript? And show us client-side script too. Edited December 8, 2012 by Guest
manve1 Posted December 8, 2012 Author Posted December 8, 2012 No errors, after all, i use debugscript 3 for all of my scripts EDIT: This is server-side Looking for tutorials or information? check out: www.simpleask.co.uk
AhmadQTR Posted December 8, 2012 Posted December 8, 2012 Show us the client-side script. Nobody is perfect , I'm nobody. Skype : ahmad.nasser37
manve1 Posted December 8, 2012 Author Posted December 8, 2012 (edited) addEvent('needTheSh*t', true) addEventHandler('needTheSh*t', getLocalPlayer(), function() local bar = guiCreateProgressBar( 0.05, 0.75, 0.9, 0.05, true, computerGUI ) outputChatBox('#FF0000[iNFO]: #FFFFFFHacking in progress...', 255, 255, 255, true) capturing = setTimer( function() guiProgressBarSetProgress(bar, guiProgressBarGetProgress(bar) + 5) if ( guiProgressBarGetProgress(bar) == 100 ) then outputChatBox('#FF0000[iNFO]: #FFFFFFHacking finnished.', 255, 255, 255, true) triggerServerEvent('changecolor1topdeck', localPlayer) killTimer( capturing ) if isElement( bar ) and (bar) then destroyElement( bar ) end end end, 1000, 0 ) addEvent('noNeedTheSh*t', true) addEventHandler('noNeedTheSh*t', getLocalPlayer(), function() if isElement( bar ) and (bar) then destroyElement( bar ) if ( capturing ) then killTimer( capturing ) end end end ) end ) Edited December 8, 2012 by Guest Looking for tutorials or information? check out: www.simpleask.co.uk
AhmadQTR Posted December 8, 2012 Posted December 8, 2012 :~ Event is handled 2 times. Any errors at debugscript 3? Nobody is perfect , I'm nobody. Skype : ahmad.nasser37
manve1 Posted December 8, 2012 Author Posted December 8, 2012 MTA forums changed the real name of event handlers ... and no no errors Looking for tutorials or information? check out: www.simpleask.co.uk
Castillo Posted December 8, 2012 Posted December 8, 2012 Where do you execute the function: "nana" ? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
manve1 Posted December 8, 2012 Author Posted December 8, 2012 Ur right, but what event should i use? Looking for tutorials or information? check out: www.simpleask.co.uk
Castillo Posted December 8, 2012 Posted December 8, 2012 You want to use it after the marker color has been set? if so: local topdeck = createMarker( 170, 255, 9.5, 'cylinder', 2.0, 255, 255, 255, 100 ) addEvent ( 'changecolor1topdeck', true ) addEventHandler ( 'changecolor1topdeck', getRootElement( ), function ( ) if ( getElementType ( source ) == "player" ) then local nR, nG, nB = getTeamColor ( getPlayerTeam ( source ) ) setMarkerColor ( topdeck, nR, nG, nB, 100 ) nana ( ) end end ) function nana ( ) local r1, g1, b1, a1 = getMarkerColor ( topdeck ) if ( r1 == 0 and g1 == 255 and b1 == 0 ) then outputChatBox ( '#FF0000[iNFO]: LOL Fail.', root, 255, 255, 255, true ) end end San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
manve1 Posted December 8, 2012 Author Posted December 8, 2012 ty Looking for tutorials or information? check out: www.simpleask.co.uk
Castillo Posted December 8, 2012 Posted December 8, 2012 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Castillo Posted December 8, 2012 Posted December 8, 2012 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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