joao1234 Posted March 20, 2013 Posted March 20, 2013 Hey guys i want to make a wanted level system, but i want to show the player wanted level in his nametag like: *An0n-[WantedLevel] what functions should i use to do it?
iPrestege Posted March 20, 2013 Posted March 20, 2013 -- Server -- Function's getPlayerWantedLevel getPlayerName outputChatBox cancelEvent Event : "onPlayerChat" Try This Server Side : addEventHandler("onPlayerChat",root, function (text, msgtype) local name = getPlayerName( source ); local Wanted = getPlayerWantedLevel ( source ); cancelEvent() outputChatBox("[ "..Wanted.." ] ".. name .. " : " .. text, root, 255, 255, 255, true); end );
Anderl Posted March 20, 2013 Posted March 20, 2013 -- Server -- Function's getPlayerWantedLevel getPlayerName outputChatBox cancelEvent Event : "onPlayerChat" Try This Server Side : addEventHandler("onPlayerChat",root, function (text, msgtype) local name = getPlayerName( source ); local Wanted = getPlayerWantedLevel ( source ); cancelEvent() outputChatBox("[ "..Wanted.." ] ".. name .. " : " .. text, root, 255, 255, 255, true); end ); He wants in the nametag, not in the chat.
iPrestege Posted March 20, 2013 Posted March 20, 2013 -- Server -- Function's getPlayerWantedLevel getPlayerName outputChatBox cancelEvent Event : "onPlayerChat" Try This Server Side : addEventHandler("onPlayerChat",root, function (text, msgtype) local name = getPlayerName( source ); local Wanted = getPlayerWantedLevel ( source ); cancelEvent() outputChatBox("[ "..Wanted.." ] ".. name .. " : " .. text, root, 255, 255, 255, true); end ); He wants in the nametag, not in the chat. Ah , Sorry Will I Will Edit it soon .
joao1234 Posted March 20, 2013 Author Posted March 20, 2013 yes its in the nametag xDband thx Pai_[N]
X-SHADOW Posted March 20, 2013 Posted March 20, 2013 it's Easy to do , setTimer ( function () for index,player in pairs (getElementsByType("player")) do setPlayerNametagText(player,getPlayerName(player).."["..tostring(getPlayerWantedLevel (player)).."]") end end , 5000 , 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