Baseplate Posted August 17, 2011 Share 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?? Link to comment
E-mail Posted August 17, 2011 Share Posted August 17, 2011 setElementData ( thePlayer, "wanted level", 3 ) --3 is inserted in the player's wanted level column Link to comment
Baseplate Posted August 17, 2011 Author Share Posted August 17, 2011 uhh...epic fail what can u see at the second line Link to comment
E-mail Posted August 17, 2011 Share Posted August 17, 2011 why dont you make meta.xml and test the script with /debugscript 3 and see the worng ? Link to comment
Baseplate Posted August 17, 2011 Author Share Posted August 17, 2011 u see I'm noobish? because I think it won't work and no error on debug Link to comment
Castillo Posted August 17, 2011 Share 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? Link to comment
Baseplate Posted August 17, 2011 Author Share Posted August 17, 2011 I wanna make a wanted Level column at Scoreboard (Code token from Wiki) Link to comment
Castillo Posted August 17, 2011 Share 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. Link to comment
Baseplate Posted August 17, 2011 Author Share Posted August 17, 2011 uhh 1 is enough I'll edit it thanks for it Link to comment
Axel Posted August 19, 2011 Share 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. Link to comment
Castillo Posted August 21, 2011 Share 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) 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