mr.Extreme Posted January 16, 2014 Posted January 16, 2014 hello i want help what the problem here local lowerBound,upperBound = unpack(get"color_range") g_Root = getRootElement () g_ResourceRoot = getResourceRootElement ( getThisResource () ) addEventHandler ( "onResourceStart", g_ResourceRoot, function() for i,player in ipairs(getElementsByType"player") do processPlayer ( player ) end end ) function processPlayer ( player ) if not isElement(blip) then blip = createBlipAttachedTo(source) end local theTeam = getPlayerTeam(source) if theTeam then local r, g, b = getTeamColor(theTeam) setPlayerNametagColor(source, r, g, b) setBlipColor(blip, r, g, b, 255) else --[[if not isElement(blip1[source]) then blip1[source] = createBlipAttachedTo(source) end]] player = player or source local rr, gg, bb = math.random(lowerBound, upperBound), math.random(lowerBound, upperBound), math.random(lowerBound, upperBound) setPlayerNametagColor(player, rr, gg, bb) --setBlipColor(blip1[source], rr, gg, bb, 255) --destroyElement(blip[source]) end end addEventHandler ( "onPlayerLogin", getRootElement(), processPlayer ) function setColorPlayer() if not isElement(blips) then blips = createBlipAttachedTo(source) end player = player or source local rr, gg, bb = math.random(lowerBound, upperBound), math.random(lowerBound, upperBound), math.random(lowerBound, upperBound) setPlayerNametagColor(player, rr, gg, bb) setBlipColor(blips, rr, gg, bb, 255) end addEventHandler("onPlayerJoin", getRootElement(), setColorPlayer) function ifnottheteam() local theTeams = getPlayerTeam(source) if not theTeams then destroyElement(blip) end if theTeams then destroyElement(blips) end end addEventHandler("onPlayerLogin", getRootElement(), ifnottheteam) addEventHandler("onPlayerQuit", root, function() if isElement(blip) then destroyElement(blip) destroyElement(blips) end end ) --[[ addEventHandler('onPlayerChat', g_Root, function(msg, type) if type == 0 then cancelEvent() local r, g, b = getPlayerColor(source) local name = getPlayerName(source) local msg = msg:gsub('#%x%x%x%x%x%x', '') outputChatBox( name.. ': #FFFFFF' .. msg, g_Root, r, g, b, true) outputServerLog( "CHAT: " .. name .. ": " .. msg ) end end ) ]] getPlayerColor = getPlayerNametagColor getPlayerColour = getPlayerNametagColor
K4stic Posted January 16, 2014 Posted January 16, 2014 any error in /debugscript 3 ? Giving a Fuck? Nope, That isn't in My Skill Set
mr.Extreme Posted January 16, 2014 Author Posted January 16, 2014 any error in /debugscript 3 ? i know but i don't know how to fix it .
DNL291 Posted January 16, 2014 Posted January 16, 2014 local lowerBound,upperBound = unpack(get"color_range") (get"color_range") It's wrong. Please do not PM me with scripting related question nor support, use the forums instead.
Bzz335 Posted January 17, 2014 Posted January 17, 2014 local lowerBound,upperBound = unpack(get"color_range") lol. Police job script progress: 100% Courier job script progress::7%
Castillo Posted January 17, 2014 Posted January 17, 2014 local lowerBound,upperBound = unpack(get"color_range") (get"color_range") It's wrong. How exactly is it wrong? because he forgot about the parentheses before " and after "? if so, then you are wrong, because that'll work anyway. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
mr.Extreme Posted January 17, 2014 Author Posted January 17, 2014 local lowerBound,upperBound = unpack(get"color_range") (get"color_range") It's wrong. local lowerBound,upperBound = unpack(get"color_range") lol. what about meta.xml "color_range" value="[ [ 50, 255 ] ]" />
Anubhav Posted January 17, 2014 Posted January 17, 2014 meta? wrong it should be: : See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
DNL291 Posted January 17, 2014 Posted January 17, 2014 local lowerBound,upperBound = unpack(get"color_range") (get"color_range") It's wrong. How exactly is it wrong? because he forgot about the parentheses before " and after "? if so, then you are wrong, because that'll work anyway. My bad, I never used the get function, thought it was needed parentheses. Please do not PM me with scripting related question nor support, use the forums instead.
Castillo Posted January 18, 2014 Posted January 18, 2014 Is not about that function only, you can do it with other functions, example: for _, player in ipairs ( getElementsByType "player" ) do -- Code here end San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
DNL291 Posted January 18, 2014 Posted January 18, 2014 (edited) Oh, and it work only for strings? I really didn't know that... Sorry for Offtopic. Edited January 19, 2014 by Guest Please do not PM me with scripting related question nor support, use the forums instead.
Castillo Posted January 18, 2014 Posted January 18, 2014 Yes, I think it only works with strings. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
mr.Extreme Posted January 19, 2014 Author Posted January 19, 2014 color player has been fixed successfully
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