xXMADEXx Posted June 8, 2013 Posted June 8, 2013 Try this: function teleportPlayer( ) if source == GUIEditor.button[1] then triggerServerEvent("movePlayerToBotafogo",getLocalPlayer(),1479.6,-1612.8,14.0,0) outputChatBox("Bem vindo ao botafogo!") end end addEventHandler ( "onClientGUIClick", root, teleportPlayer )
ice_brasil Posted June 8, 2013 Author Posted June 8, 2013 error:client triggered serversire event movePlayerToBotafogo, but event is not added serverside I've tried later add the function in a more serverside not work neither in the clientside nor serverside in the same error
Dealman Posted June 8, 2013 Posted June 8, 2013 Try this, I have not tried it myself though. Client-Side: function teleportPlayer() if(source == GUIEditor.button[1]) then local teleportX, teleportY, teleportZ = 1479.6, -1612.8, 14.0 triggerServerEvent("movePlayerToBotafogo", getLocalPlayer(), getLocalPlayer(), teleportX, teleportY, teleportZ) outputChatBox("Bem vindo ao botafogo!") end end addEventHandler("onClientGUIClick", root, teleportPlayer) Server-Side: function teleportPlayer_Server_Handler(thePlayer, teleportX, teleportY, teleportZ) setElementPosition(thePlayer, teleportX, teleportY, teleportZ) end addEvent("movePlayerToBotafog", true) addEventHandler("movePlayerToBotafog", getRootElement(), teleportPlayer_Server_Handler)
ice_brasil Posted June 8, 2013 Author Posted June 8, 2013 error:client triggered serversire event movePlayerToBotafogo, but event is not added serverside of the same mistake I've done everything right and put the clientside on the serverside and nothing!
iPrestege Posted June 8, 2013 Posted June 8, 2013 You forgot 'o' at the event handler and event at the server side change it .
ice_brasil Posted June 8, 2013 Author Posted June 8, 2013 do not know what it might add! can add me? Do not know much about gui
iPrestege Posted June 8, 2013 Posted June 8, 2013 Change this server side : [lua]function teleportPlayer_Server_Handler(thePlayer, teleportX, teleportY, teleportZ) setElementPosition(thePlayer, teleportX, teleportY, teleportZ) end addEvent("movePlayerToBotafogo", true) addEventHandler("movePlayerToBotafogo", getRootElement(), teleportPlayer_Server_Handler) [/lua]
ice_brasil Posted June 8, 2013 Author Posted June 8, 2013 is showing the outputchatbox normally, however the player is not being teleported: IF the error in the console continues ...
iPrestege Posted June 8, 2013 Posted June 8, 2013 function teleportPlayer() if(source == GUIEditor.button[1]) then local teleportX, teleportY, teleportZ = 1479.6, -1612.8, 14.0 setElementPosition(getLocalPlayer(), teleportX, teleportY, teleportZ) outputChatBox("Bem vindo ao botafogo!") end end addEventHandler("onClientGUIClick", root, teleportPlayer) There's no need for a server side .
ice_brasil Posted June 8, 2013 Author Posted June 8, 2013 just one doubt: If you click this button for when the player changes to the skin that I want function teleportPlayer() if(source == GUIEditor.button[1]) then local teleportX, teleportY, teleportZ = 1479.6, -1612.8, 14.0 triggerServerEvent("movePlayerToBotafogo", getLocalPlayer(), getLocalPlayer(), teleportX, teleportY, teleportZ) guiSetVisible (GUIEditor.window[1], not guiGetVisible ( GUIEditor.window[1] ) ) outputChatBox("Bem vindo ao botafogo!") setElementModel(playerSource, 0) showCursor(false) guiSetInputEnabled(false) end end addEventHandler("onClientGUIClick", root, teleportPlayer) I added the: setElementModel(playerSource, 0) What did this wrong?
iPrestege Posted June 8, 2013 Posted June 8, 2013 -- # Client Side ! addEventHandler('onClientGUIClick',GUIEditor.button[1], function ( ) triggerServerEvent('LoadServer',localPlayer) guiSetVisible (GUIEditor.window[1], not guiGetVisible ( GUIEditor.window[1] ) ) showCursor (false) outputChatBox("Bem vindo ao botafogo!") end,false ) -- # Server Side ! addEvent('LoadServer',true) addEventHandler('LoadServer',root, function ( ) setElementPosition ( source,1479.6, -1612.8, 14.0 ) setElementModel ( source,0 ) end )
iPrestege Posted June 8, 2013 Posted June 8, 2013 Copy it again and are you sure you need the '0' 'cj' skin? .
ice_brasil Posted June 8, 2013 Author Posted June 8, 2013 Yes it is necessary to choose a panel of team, I need the skin 0. I copied again and it did not work
iPrestege Posted June 8, 2013 Posted June 8, 2013 Please tell me what the debugscript 3 say : / debugscript 3
ice_brasil Posted June 8, 2013 Author Posted June 8, 2013 Bad argument @ 'addEventHandler' [expected element at argument 2,got nill]
ice_brasil Posted June 8, 2013 Author Posted June 8, 2013 addEventHandler('onClientGUIClick',GUIEditor.button[1], function ( ) triggerServerEvent('LoadServer',localPlayer) guiSetVisible (GUIEditor.window[1], not guiGetVisible ( GUIEditor.window[1] ) ) showCursor (false) outputChatBox("Bem vindo ao botafogo!") end,false )
Castillo Posted June 8, 2013 Posted June 8, 2013 I said the whole script, it can't be just that part.
xXMADEXx Posted June 8, 2013 Posted June 8, 2013 Change this: showCursor (false) -- To: showCursor ( guiGetVisible ( GUIEditor.window[1] ) )
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