manve1 Posted September 11, 2012 Posted September 11, 2012 hey guys, i need help on triggering server side, and making server side, this time however im trying to make alive player system for race DD servers and i couldn't find on on the community client: function make() label = guiCreateLabel( 0, 0.9525, 1, 1, "ALIVE: " .. getAlivePlayers .. "", true) guiSetFont ( label, "sa-header" ) guiLabelSetColor ( label, 255, 175, 0 ) end no server side thats the problem + trigger server side EDIT: i know this code is gonna be again 100% wrong
Castillo Posted September 11, 2012 Posted September 11, 2012 getAlivePlayers is a server side function. function getAlivePlayers ( ) local players = { } for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( getElementHealth ( player ) > 0 ) then table.insert ( players, player ) end end return players end function make ( ) label = guiCreateLabel ( 0, 0.9525, 1, 1, "ALIVE: ".. #getAlivePlayers ( ), true ) guiSetFont ( label, "sa-header" ) guiLabelSetColor ( label, 255, 175, 0 ) end
manve1 Posted September 11, 2012 Author Posted September 11, 2012 i know it is serverSide, thats why i sayied trigger server side ...
Castillo Posted September 11, 2012 Posted September 11, 2012 Not required, use my function, should work.
manve1 Posted September 11, 2012 Author Posted September 11, 2012 no i even tryied changing position of the label to center of screen still nope
TAPL Posted September 11, 2012 Posted September 11, 2012 no i even tryied changing position of the label to center of screen still nope Do you need it to be in function? Try without function. label = guiCreateLabel ( 0.5, 0.5, 0.2, 0.5, "ALIVE: ".. #getAlivePlayers ( ), true ) guiSetFont ( label, "sa-header" ) guiLabelSetColor ( label, 255, 175, 0 )
manve1 Posted September 13, 2012 Author Posted September 13, 2012 how does it work for you but not me?? http://i.imgur.com/3VoY8.png P.S. Picture is too big for mta forums, so just click on the link. could you post client+ server side of yours? cuz i got your bit as client and alive players from solid ( the server side )
TAPL Posted September 13, 2012 Posted September 13, 2012 how does it work for you but not me??http://i.imgur.com/3VoY8.png P.S. Picture is too big for mta forums, so just click on the link. could you post client+ server side of yours? cuz i got your bit as client and alive players from solid ( the server side ) You didn't understanding what Solid said. There no need for server side. The function that Solid has post it, made to use in client side.
manve1 Posted September 13, 2012 Author Posted September 13, 2012 I got other problems now i got now so confused meta: and why i got confused: If you can help me, post meta how should look. and is i take client out of meta, it gets new error, when i make to 1 script, it gets another error... so i got so confused with this now.
manve1 Posted September 13, 2012 Author Posted September 13, 2012 label = guiCreateLabel ( 0, 0.9525, 1, 1, "ALIVE: ".. #getAlivePlayers ( ), true ) guiSetFont ( label, "sa-header" ) guiLabelSetColor ( label, 255, 175, 0 )
Castillo Posted September 13, 2012 Posted September 13, 2012 See? you forgot to copy the source code of: "getAlivePlayers".
manve1 Posted September 13, 2012 Author Posted September 13, 2012 i done it wrong way, still thanx, cuz is not u solid i wouldn't of had this working
manve1 Posted September 13, 2012 Author Posted September 13, 2012 yes, it was my mistake. sorry about it
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