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 Looking for tutorials or information? check out: www.simpleask.co.uk
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 San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
manve1 Posted September 11, 2012 Author Posted September 11, 2012 i know it is serverSide, thats why i sayied trigger server side ... Looking for tutorials or information? check out: www.simpleask.co.uk
Castillo Posted September 11, 2012 Posted September 11, 2012 Not required, use my function, should work. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
manve1 Posted September 11, 2012 Author Posted September 11, 2012 to bad it dont create the label Looking for tutorials or information? check out: www.simpleask.co.uk
Castillo Posted September 11, 2012 Posted September 11, 2012 Any error in the debugscript? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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 Looking for tutorials or information? check out: www.simpleask.co.uk
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 11, 2012 Author Posted September 11, 2012 still nope Looking for tutorials or information? check out: www.simpleask.co.uk
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 ) Looking for tutorials or information? check out: www.simpleask.co.uk
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 oh, sorry im not english .. Looking for tutorials or information? check out: www.simpleask.co.uk
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. Looking for tutorials or information? check out: www.simpleask.co.uk
Castillo Posted September 13, 2012 Posted September 13, 2012 Post the content of: "c2.lua". San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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 ) Looking for tutorials or information? check out: www.simpleask.co.uk
Castillo Posted September 13, 2012 Posted September 13, 2012 See? you forgot to copy the source code of: "getAlivePlayers". San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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 Looking for tutorials or information? check out: www.simpleask.co.uk
Castillo Posted September 13, 2012 Posted September 13, 2012 It's working now? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
manve1 Posted September 13, 2012 Author Posted September 13, 2012 yes, it was my mistake. sorry about it Looking for tutorials or information? check out: www.simpleask.co.uk
Castillo Posted September 13, 2012 Posted September 13, 2012 Ok. You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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