TheRealCow Posted July 7, 2010 Posted July 7, 2010 addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( player ) if (source == GUIEditor_Button[16]) then player = getLocalPlayer() local red = guiGetText ( GUIEditor_Edit[4] ) local green = guiGetText ( GUIEditor_Edit[5] ) local blue = guiGetText ( GUIEditor_Edit[6] ) setPlayerNametagColor ( player, red, green, blue ) end end ) idk why, but the player nametag color wont change. no error in debug. Server Name: mR|Team Clan Race Server Server IP: 84.82.81.225:22004
50p Posted July 7, 2010 Posted July 7, 2010 I'm surprised you don't get an error or warning even... Do you ever use "debugscript 3" command? You can't pass string to setPlayerNametagColor... They have to be numbers. So, what about tonumber( red )? Why not make it server-side so that others can see the change? - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
TheRealCow Posted July 7, 2010 Author Posted July 7, 2010 i was used /debugscript 3 ... hmm, when i do it in client side, then the other players dont see that ? Server Name: mR|Team Clan Race Server Server IP: 84.82.81.225:22004
50p Posted July 7, 2010 Posted July 7, 2010 i was used /debugscript 3 ... hmm, when i do it in client side, then the other players dont see that ? Obviously not... Client-side scripts don't affect the server. Server doesn't know about you changing colour so how would other players know about it? - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
TheRealCow Posted July 7, 2010 Author Posted July 7, 2010 hmm i made it to server side: -client: addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( player ) if (source == GUIEditor_Button[16]) then gMe = getLocalPlayer() local red = guiGetText ( GUIEditor_Edit[4] ) local green = guiGetText ( GUIEditor_Edit[5] ) local blue = guiGetText ( GUIEditor_Edit[6] ) triggerServerEvent ( "nametagcolor", gMe, red, green, blue ) end end ) -server: function nametagcolor ( player, red, green, blue ) setPlayerNametagColor ( player, tonumber(red), tonumber(green), tonumber(blue) ) end addEvent ( "nametagcolor", true ) addEventHandler ( "nametagcolor", getRootElement(), nametagcolor ) debug: Bad argument @ setPlayerNametagColor - line 2 Server Name: mR|Team Clan Race Server Server IP: 84.82.81.225:22004
50p Posted July 7, 2010 Posted July 7, 2010 You pass only 3 arguments in triggerServerEvent but you use 4 in server-side event handler. You used gMe as 2nd argument in triggerServerEvent, so this is going to be source. Remove player from nametagcolor function and use source in setPlayerNametagColor. - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
TheRealCow Posted July 7, 2010 Author Posted July 7, 2010 function nametagcolor ( red, green, blue ) setPlayerNametagColor ( source, tonumber(red), tonumber(green), tonumber(blue) ) end addEvent ( "nametagcolor", true ) addEventHandler ( "nametagcolor", getRootElement(), nametagcolor ) still dosent do enything. no errors Server Name: mR|Team Clan Race Server Server IP: 84.82.81.225:22004
TheRealCow Posted July 7, 2010 Author Posted July 7, 2010 oke, enyway, thx 50p, idk why, but it wasnt showed nametag color, when freeroam wasnt runned. When freeroam run, then it works thx Server Name: mR|Team Clan Race Server Server IP: 84.82.81.225:22004
TheRealCow Posted July 7, 2010 Author Posted July 7, 2010 one question more.. did all client side things been showed only local player? like settVehicleHeadlightColor and those?? Server Name: mR|Team Clan Race Server Server IP: 84.82.81.225:22004
50p Posted July 7, 2010 Posted July 7, 2010 Everything client-side is only shown and affects the player on whom the script executes. If you change headlights colour in a client-side script, only that person will see the effects. - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
TheRealCow Posted July 7, 2010 Author Posted July 7, 2010 damn, need to remake that script Server Name: mR|Team Clan Race Server Server IP: 84.82.81.225:22004
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