lollipop Posted July 11, 2013 Share Posted July 11, 2013 Hi, this is my second script. I wanna make a join quit with image, but, don´t work, idk why..Please help.. script_c.lua addEvent ("join", true) function join () guiCreateStaticImage ( 0.7, 0.1, 0.2, 0.1, "bg.png" ) guiCreateLabel ( 0.7, 0.1, 0.2, 0.1, "Player"..getPlayerName"has joined the game." ) end addEventHandler("join", getRootElement(), join) script_s.lua addEventHandler("onPlayerJoin", root, function() triggerClientEvent("join", getRootElement(), source) end) It´s only start... Link to comment
iPrestege Posted July 11, 2013 Share Posted July 11, 2013 Try this ; -- # Client addEvent('g_Add',true) addEventHandler('g_Add',root, function ( g_Name ) if isElement ( g_Image ) then destroyElement ( g_Image ) g_Image = nil end; if isElement ( g_Label ) then destroyElement ( g_Label ) g_Label = nil end; g_Image = guiCreateStaticImage ( 0.7, 0.1, 0.2, 0.1, "1.png",true ); g_Label = guiCreateLabel ( 0.7, 0.1, 0.2, 0.1,'',true ); guiSetText ( g_Label,'Player '..g_Name..' Has joined the game.' ); end ); -- # Server addEventHandler('onPlayerJoin',root, function ( ) triggerClientEvent ( 'g_Add',root,getPlayerName ( source ) ); end ); Link to comment
lollipop Posted July 11, 2013 Author Share Posted July 11, 2013 Still nothing........ Link to comment
فاّرس Posted July 11, 2013 Share Posted July 11, 2013 I'm do not know the wrong ,, But try this with code iFahad, addEventHandler('onPlayerJoin',root, function ( ) triggerClientEvent (root,'g_Add',root,getPlayerName ( source ) ); end ); Link to comment
arezu Posted July 11, 2013 Share Posted July 11, 2013 Still nothing........ You know that it will only show for all players except for the player that joined right? so you need at least two players to test it. Link to comment
lollipop Posted July 11, 2013 Author Share Posted July 11, 2013 Still nothing........ You know that it will only show for all players except for the player that joined right? so you need at least two players to test it. No, because it dont have timer O_O Link to comment
PaiN^ Posted July 11, 2013 Share Posted July 11, 2013 Try it with the event onPlayerWasted, Kill your self and see if it works . Link to comment
lollipop Posted July 11, 2013 Author Share Posted July 11, 2013 Try it with the event onPlayerWasted, Kill your self and see if it works . Nope, i tested it with onPlayerLogin.. Link to comment
iPrestege Posted July 11, 2013 Share Posted July 11, 2013 Make sure you changed the path '1.png' to 'bg.png' in the client side + post the meta with code. Link to comment
lollipop Posted July 11, 2013 Author Share Posted July 11, 2013 Make sure you changed the path '1.png' to 'bg.png' in the client side + post the meta with code. Yea, i changed it... meta: >author="noxes" type="script" /> ="script_c.lua" type="client" />="script_s.lua" type="server" /> > Link to comment
iPrestege Posted July 11, 2013 Share Posted July 11, 2013 I don't see that you add the image to the meta file? Link to comment
lollipop Posted July 11, 2013 Author Share Posted July 11, 2013 I don't see that you add the image to the meta file? Ou f*ck... xDDDDDDDDDDDDDDDDDD I´m stupid.... Thank you...Now work Link to comment
iPrestege Posted July 11, 2013 Share Posted July 11, 2013 I don't see that you add the image to the meta file? Ou f*ck... xDDDDDDDDDDDDDDDDDD I´m stupid.... Thank you...Now work Not at all . Link to comment
lollipop Posted July 11, 2013 Author Share Posted July 11, 2013 And....How i can create "guiCreateLabel" with color ?...I mean...Now it is: Player #ffffffXXX has joined the game. And i want only Player XXX(white color) has joined the game. Can i this ? Link to comment
lollipop Posted July 11, 2013 Author Share Posted July 11, 2013 Remove hex colors? Eh, ye but...i want this color in name...Not hex Link to comment
iPrestege Posted July 11, 2013 Share Posted July 11, 2013 Remove hex colors? Eh, ye but...i want this color in name...Not hex So remove the color >< ? Link to comment
lollipop Posted July 11, 2013 Author Share Posted July 11, 2013 Ah... ..... Now i have: Player #ff0000NoXe has joined the game. I want: Player NoXe has joined the game. Link to comment
iPrestege Posted July 11, 2013 Share Posted July 11, 2013 Ah... ..... Now i have: Player #ff0000NoXe has joined the game. I want: Player NoXe has joined the game. You can't use hex colors with label color do it using : dxDrawText + onClientRender To draw the text ! Link to comment
lollipop Posted July 11, 2013 Author Share Posted July 11, 2013 Ah... ..... Now i have: Player #ff0000NoXe has joined the game. I want: Player NoXe has joined the game. You can't use hex colors with label color do it using : dxDrawText + onClientRender To draw the text ! Ou, i dont know work with dx >.< Link to comment
iPrestege Posted July 11, 2013 Share Posted July 11, 2013 You can use the latest gui editor ver and use Drawing options . Link to comment
myonlake Posted July 11, 2013 Share Posted July 11, 2013 Look at the examples in the Wiki and try them out. It's rather simple after all. I didn't know crap about it myself either back some years ago and now it goes like liquid. Go and try and let us know if something's not right. Don't be afraid of trying out new stuff - otherwise you will always stay at that level of experience Link to comment
lollipop Posted July 12, 2013 Author Share Posted July 12, 2013 Omg, i dont know create dxDrawText....I´m only beginner in scripting...and your script is in heavier shape... addEvent('g_Add',true) addEventHandler('g_Add',root, function ( g_Name ) if isElement ( g_Image ) then destroyElement ( g_Image ) g_Image = nil end; if isElement ( g_Label ) then destroyElement ( g_Label ) g_Label = nil end; g_Image = guiCreateStaticImage ( 0.8, 0.0, 0.3, 0.03, "bg.png",true ); g_Label = dxDrawText("Player"...getPlayerName" has joined the game.", 20, 247, 792, 329, tocolor(15, 217, 0, 255), 5.00, "default-bold", "left", "top", false, false, true, false, false) end ); Link to comment
MIKI785 Posted July 12, 2013 Share Posted July 12, 2013 "Heavier shape" - WTF? Anyway, that's because dxDrawText is rendered just for one frame, so it's impossible to see it for one frame... that's why you're supposed to use onClientRender or preRender to show it continuously, refer to wiki. 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