Flipi Posted November 4, 2013 Posted November 4, 2013 whats is the problem ? I throws an error function player () local join = getPlayerName ( source ) local text = source, "#FFFFFF" ..join.. " #0080FFis logged!" dxDrawText( text, 25,166.09, screenWidth, screenHeight, tocolor(0,0,0), 1.2, "default-bold","left") dxDrawText( text, 24,166.09, screenWidth, screenHeight, tocolor(0,128,255), 1.2, "default-bold","left") end addEventHandler ( "onPlayerLogin", getRootElement(), player )
Price. Posted November 4, 2013 Posted November 4, 2013 what is the error? YOU HAVE TO TRUST SOMEONE TO BE BETRAYED.I NEVER DID
Flipi Posted November 4, 2013 Author Posted November 4, 2013 what is the error? ERROR: resource\resource.lua:4: attempt to call global 'tocolor' (a nil value)
Price. Posted November 4, 2013 Posted November 4, 2013 local tunaColor = tocolor(255, 0, 0, 255) function player () local join = getPlayerName ( source ) local text = source, "#FFFFFF" ..join.. " #0080FFis logged!" dxDrawText( text, 25,166.09, screenWidth, screenHeight, tocolor(0,0,0), 1.2, "default-bold","left") dxDrawText( text, 24,166.09, screenWidth, screenHeight, tocolor(0,128,255), 1.2, "default-bold","left") end addEventHandler ( "onPlayerLogin", getRootElement(), player ) tocolor wasn't defined, try now. YOU HAVE TO TRUST SOMEONE TO BE BETRAYED.I NEVER DID
TAPL Posted November 4, 2013 Posted November 4, 2013 onPlayerLogin is server-side. + dxDrawText need event onClientRender. + A mess here: local text = source, "#FFFFFF" ..join.. " #0080FFis logged!"
Flipi Posted November 4, 2013 Author Posted November 4, 2013 onPlayerLogin is server-side. + dxDrawText need event onClientRender. + A mess here: local text = source, "#FFFFFF" ..join.. " #0080FFis logged!" but, then how can it be?... is server-side
Price. Posted November 4, 2013 Posted November 4, 2013 check how it works, https://wiki.multitheftauto.com/wiki/OnPlayerJoin YOU HAVE TO TRUST SOMEONE TO BE BETRAYED.I NEVER DID
Flipi Posted November 4, 2013 Author Posted November 4, 2013 check how it works, https://wiki.multitheftauto.com/wiki/OnPlayerJoin but that's with outputchatbox?
Flipi Posted November 4, 2013 Author Posted November 4, 2013 triggerClientEvent would have to create a client?, because this is server-side.
Price. Posted November 4, 2013 Posted November 4, 2013 check wiki examples and it's functions explanation and you will know what you need to do. YOU HAVE TO TRUST SOMEONE TO BE BETRAYED.I NEVER DID
pa3ck Posted November 4, 2013 Posted November 4, 2013 GUI and DX functions / events are all client sided. If you need something that is server side only ( getPlayerAccount, setAccountData etc) then use triggerClientEvent from server side, else do the whole script client side.
Flipi Posted November 4, 2013 Author Posted November 4, 2013 GUI and DX functions / events are all client sided. If you need something that is server side only ( getPlayerAccount, setAccountData etc) then use triggerClientEvent from server side, else do the whole script client side. ah ok thanks !
Flipi Posted November 4, 2013 Author Posted November 4, 2013 check wiki examples and it's functions explanation and you will know what you need to do. ok thanks
Moderators IIYAMA Posted November 5, 2013 Moderators Posted November 5, 2013 this is how you do that serverside. https://wiki.multitheftauto.com/wiki/TextCreateDisplay Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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