Evil-Cod3r Posted December 18, 2011 Share Posted December 18, 2011 Hi all i have idea i want Make a resource that show the Players Name and there Health Only and get the Players team example if iam team 1 and team 1 got Players can see the Name of there frinds and there Health and team 2 the same every team see there frinds info only can any one give me the functions and events so i can start Make it ? Link to comment
Al3grab Posted December 18, 2011 Share Posted December 18, 2011 getPlayerName getPlayerTeam getElementHealth Link to comment
Evil-Cod3r Posted December 18, 2011 Author Share Posted December 18, 2011 is this right ? local name = getPlayerName(getLocalPlayer()) local team = getPlayerTeam ( source ) local dm = getElementHealth ( getLocalPlayer() ) function hp () label1 = guiCreateLabel(1240,585,125,17,"Health :",false) guiLabelSetColor(label1,255,255,0) guiSetFont(label1,"clear-normal") guiSetText ( label1, dm, team ) setTimer ( hp, 2000, 1) end addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), hp ) Link to comment
BinSlayer1 Posted December 18, 2011 Share Posted December 18, 2011 No. First, a label gets created every time the local player spawns.. If he spawns 30 times, the screen will have 30 labels and the handle element for each will be lost Secondly, you're using guiSetText with 3 arguments when it only has 2 and the second one should be a STRING. Thirdly, guiSetText syntax aside, it is simply wrong because 'team' and 'dm' never really change. They are only called once when the script loads up. Fourthly, but not least, the setTimer screws everything up even more.. (function called multiple times, see first, second and third points above) Link to comment
bandi94 Posted December 18, 2011 Share Posted December 18, 2011 label1 = guiCreateLabel(1240,585,125,17,"Health :",false) guiLabelSetColor(label1,255,255,0) guiSetFont(label1,"clear-normal") function hp () if getLocalPlayer()==source then local name = getPlayerName(getLocalPlayer()) local team = getPlayerTeam ( source ) team=getTeamName(team) local dm = getElementHealth ( getLocalPlayer() ) guiSetText ( label1,"Your name: "..name.." Your Team: "..team.." Your Health: "..dm ) setTimer ( hp, 2000, 1) end end addEventHandler ( "onClientPlayerSpawn", getRootElement(), hp ) Link to comment
Evil-Cod3r Posted December 18, 2011 Author Share Posted December 18, 2011 not i dont want he see his info i want the Players see the info of there frinds just the Name and Health Link to comment
BinSlayer1 Posted December 18, 2011 Share Posted December 18, 2011 not i dont want he see his info i want the Players see the info of there frinds just the Name and Health Sure you're not happy with him giving you a ready-script (tbh a bit bugged with the setTimer, but at least it's a start), but you also want the code to have MORE features Link to comment
Evil-Cod3r Posted December 18, 2011 Author Share Posted December 18, 2011 he give me the source info only for exmaple if BinSlayer1 and me and bandi94 are team 1 then the label name = BinSlayer1 Helath : .... bandi94 Health : .... Evil-Cod3r Health : ... like this you get it ? Link to comment
BinSlayer1 Posted December 18, 2011 Share Posted December 18, 2011 yeah but we can't make the full script for you.. use getPlayersInTeam() and make it with dxDrawText because it's easier than label. make each line of dxDrawText add 5 or 10 pixels to the screenHeight, this way the texts shouldn't go on top of each other Link to comment
Evil-Cod3r Posted December 18, 2011 Author Share Posted December 18, 2011 i think that hard for me iam new on script thx anyway for help 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