Deadmau5 Posted January 20, 2012 Posted January 20, 2012 I have a problem... Everyone that connects on my server, with namecolor, will be like this in TAB list: #FF0000Master#0000FFGamer Just an example... Any resource to fix this?
Castillo Posted January 20, 2012 Posted January 20, 2012 You can edit the scoreboard resource and add colored texts (HEX colors) or just remove the HEX colors from the nickname. This resource: https://community.multitheftauto.com/index.php?p= ... ls&id=3421 Is a function to draw a text with HEX colors enabled.
Deadmau5 Posted January 20, 2012 Author Posted January 20, 2012 I have the race starter pack and i'm really new to mta scripting... Could you show me an example?
UAEpro Posted January 20, 2012 Posted January 20, 2012 ahh i know what you are talking about just edit the scoreboard setting and put true to enable colored nickname
Deadmau5 Posted January 21, 2012 Author Posted January 21, 2012 Works Now another problem... Why it spams the chat when i use this code? function setTheCarColors( ) local playersteam = getTeamFromName( "Players" ) local membersteam = getTeamFromName( "Members" ) local moderatorsteam = getTeamFromName( "Moderators" ) local adminsteam = getTeamFromName( "Admins" ) local ownersteam = getTeamFromName( "Server Owners" ) for i, car in ipairs( getElementsByType( "vehicle" ) ) do local theplayer = getVehicleOccupant( car ) local nowteam = getPlayerTeam( theplayer ) <------------- Always showing and spamming an error at this line... if(nowteam == playersteam) then setVehicleColor(car, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0) end if(nowteam == membersteam) then setVehicleColor(car, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) end if(nowteam == moderatorsteam) then setVehicleColor(car, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) end if(nowteam == adminsteam) then setVehicleColor(car, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0) end if(nowteam == ownersteam) then setVehicleColor(car, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) end end end addEvent("onVehColorChange",true) addEventHandler("onVehColorChange",getRootElement(),setTheCarColors) function timer() --Delay it a bit to allow players to warp in their vehicle... setTimer(setTheCarColors,500,0) end addEventHandler("onMapStarting",getRootElement(),timer) addCommandHandler ( "set_vehicle_color", setTheCarColors ) The error: WARNING: putplayertoteamscript/script.lua:74: Bad argument @ 'getPlayerTeam' and that causes serverlags -.-
Orange Posted January 21, 2012 Posted January 21, 2012 Just put the code into if theplayer then -- code end
AeroXbird Posted January 21, 2012 Posted January 21, 2012 You have to define theplayer. its not defined at all.
Deadmau5 Posted January 21, 2012 Author Posted January 21, 2012 Now it works, AeroXbird ^^ But thanks to you all Pls close ^^
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