Alexs Posted July 19, 2012 Posted July 19, 2012 emmm no, esos parentesis estarian de mas y el error es un simbolo desconocido cerca de "[" es decir, el error no son los "["
Soren Posted July 19, 2012 Author Posted July 19, 2012 Solucione el error que tenia con el seleccionador de teams. Pero cuando me uno al sv no salen los botones para seleccionar el team. Client Side: GUIEditor_Button = {} GUIEditor_Button[1] = guiCreateButton(496,364,322,108,"Red Team",false) GUIEditor_Button[2] = guiCreateButton(819,364,322,108,"Blue Team",false) function() guiSetVisible ( GUIEditor_Button[1], true ) guiSetVisible ( GUIEditor_Button[2], true ) end addEventHandler("onClientGUIClick", root, function() if source == GUIEditor_Button[1] or GUIEditor_Button[2] then guiSetVisible(GUIEditor_Button[1],false) guiSetVisible(GUIEditor_Button[2],false) setCameraTarget( localPlayer ) showCursor(false) setElementPosition( localPlayer, 2580.7265625, 2328.77734375, 17.822208404541) showPlayerHudComponent ("radar",true) end end ) function redteam () triggerServerEvent ( "red", getLocalPlayer()) end addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], redteam, false ) function blueteam () triggerServerEvent ( "blue", getLocalPlayer()) end addEventHandler ( "onClientGUIClick", GUIEditor_Button[2], blueteam, false ) Server side: local red = createTeam ("Red", 255, 0, 0) local blue = createTeam ("Blue", 0, 0, 255) addEvent ("Red", true) function red () setPlayerTeam(source, red) end addEventHandler("Red", getRootElement(), red) addEvent ("Blue", true) function blue () setPlayerTeam(source, blue) end addEventHandler("Red", getRootElement(), blue)
Alexs Posted July 19, 2012 Posted July 19, 2012 (edited) Tu error de no nombrar la funcion GUIEditor_Button = {} GUIEditor_Button[1] = guiCreateButton(496,364,322,108,"Red Team",false) GUIEditor_Button[2] = guiCreateButton(819,364,322,108,"Blue Team",false) function() --aca no nombraste la funcion, usa el de abajo guiSetVisible ( GUIEditor_Button[1], true ) guiSetVisible ( GUIEditor_Button[2], true ) end addEventHandler("onClientGUIClick", root, function() if source == GUIEditor_Button[1] or GUIEditor_Button[2] then guiSetVisible(GUIEditor_Button[1],false) guiSetVisible(GUIEditor_Button[2],false) setCameraTarget( localPlayer ) showCursor(false) setElementPosition( localPlayer, 2580.7265625, 2328.77734375, 17.822208404541) showPlayerHudComponent ("radar",true) end end ) function redteam () triggerServerEvent ( "red", getLocalPlayer()) end addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], redteam, false ) function blueteam () triggerServerEvent ( "blue", getLocalPlayer()) end addEventHandler ( "onClientGUIClick", GUIEditor_Button[2], blueteam, false ) Solucionado: GUIEditor_Button = {} GUIEditor_Button[1] = guiCreateButton(496,364,322,108,"Red Team",false) GUIEditor_Button[2] = guiCreateButton(819,364,322,108,"Blue Team",false) guiSetVisible ( GUIEditor_Button[1], false ) guiSetVisible ( GUIEditor_Button[2], false ) function ponerlosbotones ( ) --asi si guiSetVisible ( GUIEditor_Button[1], true ) guiSetVisible ( GUIEditor_Button[2], true ) end addEventHandler("onClientPlayerJoin", getLocalPlayer(), remotePlayerJoin) addEventHandler("onClientGUIClick", root, function() if source == GUIEditor_Button[1] or GUIEditor_Button[2] then guiSetVisible(GUIEditor_Button[1],false) guiSetVisible(GUIEditor_Button[2],false) setCameraTarget( localPlayer ) showCursor(false) setElementPosition( localPlayer, 2580.7265625, 2328.77734375, 17.822208404541) showPlayerHudComponent ("radar",true) end end ) function redteam () triggerServerEvent ( "red", getLocalPlayer()) end addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], redteam, false ) function blueteam () triggerServerEvent ( "blue", getLocalPlayer()) end addEventHandler ( "onClientGUIClick", GUIEditor_Button[2], blueteam, false ) Edited July 19, 2012 by Guest
Castillo Posted July 19, 2012 Posted July 19, 2012 function() guiSetVisible ( GUIEditor_Button[1], true ) guiSetVisible ( GUIEditor_Button[2], true ) end Talvez porque eso no tiene sentido, borrarlo, los botones van a estar visibles al crearse.
Alexs Posted July 19, 2012 Posted July 19, 2012 function() guiSetVisible ( GUIEditor_Button[1], true ) guiSetVisible ( GUIEditor_Button[2], true ) end Talvez porque eso no tiene sentido, borrarlo, los botones van a estar visibles al crearse. Pense que si lo borraba solo se verian al iniciarse el recurso y no para cada jugador PD: Soren pasame tu Skype para hablar
Castillo Posted July 19, 2012 Posted July 19, 2012 Cuando reinicias un recurso, se ejecuta el evento: "onClientResourceStart"/"onResourceStart".
Soren Posted July 19, 2012 Author Posted July 19, 2012 function() guiSetVisible ( GUIEditor_Button[1], true ) guiSetVisible ( GUIEditor_Button[2], true ) end Talvez porque eso no tiene sentido, borrarlo, los botones van a estar visibles al crearse. Gracias Solid ahora si aparece pero no se setea el team >. @Alex: soren_master
CheiN Posted July 19, 2012 Posted July 19, 2012 paren. no entendi el quiere tambien asignar un key? para apareserlo? o solo darle start y qe aparescan los buttoms?
Castillo Posted July 19, 2012 Posted July 19, 2012 Eso es porque en el server side tus eventos son: "Red" y "Blue", pero en el client side estas usando los eventos: "red" y "blue".
Alexs Posted July 19, 2012 Posted July 19, 2012 function setteam () if ( source == GUIEditor_Button[1] ) then triggerServerEvent ( "Red", getLocalPlayer()) elseif ( source == GUIEditor_Button[2] ) then triggerServerEvent ( "Blue", getLocalPlayer()) end end addEventHandler ( "onClientGUIClick", root, setteam) addEvent ("Red", true) function red () setPlayerTeam(source, red) end addEventHandler("Red", getRootElement(), red) addEvent ("Blue", true) function blue () setPlayerTeam(source, blue) end addEventHandler("Blue", getRootElement(), blue)
Soren Posted July 19, 2012 Author Posted July 19, 2012 Use lo que puso Alex. Ya no dio error ni en la consola ni el debugscript pero no setea el team. La verdad no se que es lo que tenga mal
CheiN Posted July 19, 2012 Posted July 19, 2012 guiEdutorbuttom 1 y 2 ya no existen solid dijo qe se borraran
Alexs Posted July 19, 2012 Posted July 19, 2012 guiEdutorbuttom 1 y 2 ya no existen solid dijo qe se borraran Si existen, mira los scritps y ve lo que saco
Castillo Posted July 19, 2012 Posted July 19, 2012 Llamaste a las funciones igual que las variables de los teams, por eso no funciona seguramente.
Soren Posted July 19, 2012 Author Posted July 19, 2012 Llamaste a las funciones igual que las variables de los teams, por eso no funciona seguramente. Mil gracias Solid!!! Ya funciona. Me podrian ayudar con lo del spectate de tu team?
CheiN Posted July 19, 2012 Posted July 19, 2012 soren agregame al skype: themetaldomo sin ningun espacio en 1 o 2 horas cojere el pc porqe te estoy intentando ayudar desde el 3ds
Alexs Posted July 19, 2012 Posted July 19, 2012 No hagas doble post ni hables por aca eso, existen servidores de mensajeria instantanea como Skype o MSN
Recommended Posts