Deadmau5 Posted January 20, 2012 Share 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? Link to comment
Castillo Posted January 20, 2012 Share 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. Link to comment
Deadmau5 Posted January 20, 2012 Author Share Posted January 20, 2012 I have the race starter pack and i'm really new to mta scripting... Could you show me an example? Link to comment
UAEpro Posted January 20, 2012 Share Posted January 20, 2012 ahh i know what you are talking about just edit the scoreboard setting and put true to enable colored nickname Link to comment
Deadmau5 Posted January 21, 2012 Author Share 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: Quote WARNING: putplayertoteamscript/script.lua:74: Bad argument @ 'getPlayerTeam' and that causes serverlags -.- Link to comment
Orange Posted January 21, 2012 Share Posted January 21, 2012 Just put the code into if theplayer then -- code end Link to comment
Deadmau5 Posted January 21, 2012 Author Share Posted January 21, 2012 Thank you very much Link to comment
AeroXbird Posted January 21, 2012 Share Posted January 21, 2012 You have to define theplayer. its not defined at all. Link to comment
Deadmau5 Posted January 21, 2012 Author Share Posted January 21, 2012 Now it works, AeroXbird ^^ But thanks to you all Pls close ^^ Link to comment
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