-ffs-AbodyRulez Posted September 12, 2013 Posted September 12, 2013 addEvent("onWins", true) function screenwinning(Player) x, y = guiGetScreenSize() xR, xG, xB = getTeamColor(getPlayerTeam(Player)) winner = dxText:create(""..getTeamName(getPlayerTeam(Player)).." #FFFFFF has won a point!", x / 2, y / 2.8, false, "default-bold", 3, "center") winner:type('shadow', 1, xR, xG, xB, 175) timerTime = 5 setTimer(function()winner:visible(false)end, 5500, 1) end addEventHandler("onWins", getRootElement(),screenwinning) I need the player source, i tried if player ~= source then return end and it really returned end >.>
Azn Posted September 12, 2013 Posted September 12, 2013 Wow men dis looks like a jigsaw puzzle, pls use tabbing men. And btw you need the libtext/libanim library.
ZL|LuCaS Posted September 12, 2013 Posted September 12, 2013 (edited) addEvent("onWins", true) function screenwinning(Player) x, y = guiGetScreenSize() xR, xG, xB = getTeamColor(getPlayerTeam(Player)) winner = dxText:create(""..getTeamName(getPlayerTeam(Player)).." #FFFFFF has won a point!", x / 2, y / 2.8, false, "default-bold", 3, "center") winner:type('shadow', 1, xR, xG, xB, 175) timerTime = 5 setTimer(function()winner:visible(false)end, 5500, 1) end addEventHandler("onWins", getRootElement(),screenwinning) I need the player source, i tried if player ~= source then return end and it really returned end >.> function addTeamColor(player) local playerTeam = getPlayerTeam ( player ) if ( playerTeam ) then local r,g,b = getTeamColor ( playerTeam ) local n1 = toHex(r) local n2 = toHex(g) local n3 = toHex(b) if r <= 16 then n1 = "0"..n1 end if g <= 16 then n2 = "0"..n2 end if b <= 16 then n3 = "0"..n3 end return "#"..n1..""..n2..""..n3..""..getPlayerNametagText(player) else return getPlayerNametagText(player) end end function toHex ( n ) local hexnums = {"0","1","2","3","4","5","6","7", "8","9","A","B","C","D","E","F"} local str,r = "",n%16 if n-r == 0 then str = hexnums[r+1] else str = toHex((n-r)/16)..hexnums[r+1] end return str end addEvent("onWins", true) function screenwinning(Player) x, y = guiGetScreenSize() PlayerName = addTeamColor(player) xR, xG, xB = getTeamColor(getPlayerTeam(Player)) winner = dxText:create("* "..PlayerName.." #FFFFFF has won a point!", x / 2, y / 2.8, false, "default-bold", 3, "center") winner:type('shadow', 1, xR, xG, xB, 175) timerTime = 5 setTimer(function()winner:visible(false)end, 5500, 1) end addEventHandler("onWins", getRootElement(),screenwinning) triggerClientEvent ( "onWins", getRootElement(),activePlayers[1]) Edited September 12, 2013 by Guest MTA Scripters. ♥♥♥Beijinhos♥♥♥
denny199 Posted September 12, 2013 Posted September 12, 2013 Where's the toHex function, lal https://wiki.multitheftauto.com/wiki/ToHex Sometimes I dream about cheese
ZL|LuCaS Posted September 12, 2013 Posted September 12, 2013 Where's the toHex function, lalhttps://wiki.multitheftauto.com/wiki/ToHex fixed; I thought I had put MTA Scripters. ♥♥♥Beijinhos♥♥♥
Moderators IIYAMA Posted September 12, 2013 Moderators Posted September 12, 2013 you can also use this one: https://wiki.multitheftauto.com/wiki/RGBToHex Then you only have to call the/a function one time. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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