Baseplate Posted August 17, 2011 Posted August 17, 2011 call(getResourceFromName("dxscoreboard"), "addScoreboardColumn", "wanted level") setElementData ( thePlayer, "wanted level", 3 ) is this code is right to show Wanted Level column in dxscoreboard??
E-mail Posted August 17, 2011 Posted August 17, 2011 setElementData ( thePlayer, "wanted level", 3 ) --3 is inserted in the player's wanted level column
Baseplate Posted August 17, 2011 Author Posted August 17, 2011 uhh...epic fail what can u see at the second line
E-mail Posted August 17, 2011 Posted August 17, 2011 why dont you make meta.xml and test the script with /debugscript 3 and see the worng ?
Baseplate Posted August 17, 2011 Author Posted August 17, 2011 u see I'm noobish? because I think it won't work and no error on debug
Castillo Posted August 17, 2011 Posted August 17, 2011 Samer, I wouldn't listen to him, as far as I can see from his/her post's is... he's trying to get his post count higher, nothing more. And now, back in topic: You are creating a column in the scoreboard, but about the setElementData, thePlayer has to be a valid element, is this your full script?
Baseplate Posted August 17, 2011 Author Posted August 17, 2011 I wanna make a wanted Level column at Scoreboard (Code token from Wiki)
Castillo Posted August 17, 2011 Posted August 17, 2011 call(getResourceFromName("dxscoreboard"), "addScoreboardColumn", "wanted level") addEventHandler("onPlayerWasted",root, function (_,killer) if killer == source then return end setElementData ( killer, "wanted level", 3 ) end) Should give the killer 3 wanted stars.
Baseplate Posted August 17, 2011 Author Posted August 17, 2011 uhh 1 is enough I'll edit it thanks for it
Axel Posted August 19, 2011 Posted August 19, 2011 If you want to show the wanted score in the scoreboard you should use call(getResourceFromName("dxscoreboard"),"addScoreboardColumn","Wanted Level",root,70) function check() for w in ipairs(getElementsByType('player')) do local wanted = getPlayerWantedLevel(w) setElementData(w,"Wanted Level",wanted ) end setTimer(check, 10000, 0) This will check every player wanted level and show it in that colum.
Castillo Posted August 21, 2011 Posted August 21, 2011 Nop, that won't work Axel, the 'for' loop is wrong. call(getResourceFromName("dxscoreboard"), "addScoreboardColumn", "wanted level") function check() for index, player in ipairs(getElementsByType("player")) do local wanted = getPlayerWantedLevel(player) setElementData(player,"Wanted level", tostring(wanted)) end setTimer(check, 10000, 0)
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