vinexX Posted November 19, 2016 Share Posted November 19, 2016 Hola amigos otra vez pidiendo ayuda ya me da un poco de vergüenza jaja Bueno quería saber si me pueden ayudar a solucionar este error, lo que quiero hacer es que al apretar un botón me de un team pero en vez de darme un team me salta un error y no me da nada. ERROR: client (#CBFF00VinexX) triggered serverside event ganster, but event is not added serverside, Desde ya muchas gracias otra vez.. client: addEventHandler("onClientResourceStart", resourceRoot, function () ventana = guiCreateWindow(147, 212, 534, 273, "Selector de Teams | Street Gang", false) guiWindowSetSizable(ventana, false) botonlossantos = guiCreateButton(19, 58, 164, 45, "Los Santos Crew", false, ventana) guiSetFont(botonlossantos, "default-bold-small") guiSetProperty(botonlossantos, "NormalTextColour", "FFAAAAAA") addEventHandler("onClientGUIClick", botonlossantos, entrarTeam, false) botonballas = guiCreateButton(354, 58, 164, 45, "Ballas Street", false, ventana) guiSetFont(botonballas, "default-bold-small") guiSetProperty(botonballas, "NormalTextColour", "FFAAAAAA") botonvagos = guiCreateButton(190, 113, 164, 45, "The Vagos Blood", false, ventana) guiSetFont(botonvagos, "default-bold-small") guiSetProperty(botonvagos, "NormalTextColour", "FFAAAAAA") botonaztecas = guiCreateButton(354, 168, 164, 45, "Aztecas Family", false, ventana) guiSetFont(botonaztecas, "default-bold-small") guiSetProperty(botonaztecas, "NormalTextColour", "FFAAAAAA") botongrove = guiCreateButton(19, 168, 164, 45, "Groove Danger ", false, ventana) guiSetFont(botongrove, "default-bold-small") guiSetProperty(botongrove, "NormalTextColour", "FFAAAAAA") labeeel = guiCreateLabel(158, 223, 218, 15, "Selecciona El Team Que mas Te guste.", false, ventana) guiSetFont(labeeel, "default-bold-small") guiLabelSetColor(labeeel, 8, 114, 246) showCursor(true) end ) function entrarTeam() triggerServerEvent("ganster",localPlayer) guiSetVisible(ventana, false) showCursor(false) end addEventHandler("onClientGUIClick", botonlossantos , entrarTeam,false) server: function team () gansta = createTeam ("Los Santos Crew", 6, 183, 248) end addEventHandler ("onResourceStart", resourceRoot, team) function darteam() setPlayerTeam(source,gansta) outputChatBox("Bienvenido, Ahora perteneces Al gang (Los Santos Crew).",source,0,255,0) end addEvent("ganster", true) addEventHandler("ganster",root,darteam) Link to comment
Sticmy Posted November 19, 2016 Share Posted November 19, 2016 Cambie un poco de las funciones quizás te sirva para todo tus paneles.. Client: addEventHandler("onClientResourceStart", resourceRoot, function () ventana = guiCreateWindow(147, 212, 534, 273, "Selector de Teams | Street Gang", false) guiWindowSetSizable(ventana, false) botonlossantos = guiCreateButton(19, 58, 164, 45, "Los Santos Crew", false, ventana) guiSetFont(botonlossantos, "default-bold-small") guiSetProperty(botonlossantos, "NormalTextColour", "FFAAAAAA") addEventHandler("onClientGUIClick", botonlossantos, entrarTeam, false) botonballas = guiCreateButton(354, 58, 164, 45, "Ballas Street", false, ventana) guiSetFont(botonballas, "default-bold-small") guiSetProperty(botonballas, "NormalTextColour", "FFAAAAAA") botonvagos = guiCreateButton(190, 113, 164, 45, "The Vagos Blood", false, ventana) guiSetFont(botonvagos, "default-bold-small") guiSetProperty(botonvagos, "NormalTextColour", "FFAAAAAA") botonaztecas = guiCreateButton(354, 168, 164, 45, "Aztecas Family", false, ventana) guiSetFont(botonaztecas, "default-bold-small") guiSetProperty(botonaztecas, "NormalTextColour", "FFAAAAAA") botongrove = guiCreateButton(19, 168, 164, 45, "Groove Danger ", false, ventana) guiSetFont(botongrove, "default-bold-small") guiSetProperty(botongrove, "NormalTextColour", "FFAAAAAA") labeeel = guiCreateLabel(158, 223, 218, 15, "Selecciona El Team Que mas Te guste.", false, ventana) guiSetFont(labeeel, "default-bold-small") guiLabelSetColor(labeeel, 8, 114, 246) showCursor(true) end ) addEventHandler("onClientGUIClick", resourceRoot, function() if source == botonlossantos then triggerServerEvent("ganster",localPlayer) guiSetVisible(ventana, false) showCursor(false) --elseif source == botonballas then puedes poner los demás botones con el elseif source == variable then no es necedidad de crear muchos eventos con el onClientGUIClick. end end ) Server: gansta = createTeam ("Los Santos Crew", 6, 183, 248) addEventHandler("gangster", true) addEventHandler("gangster", root, function() setPlayerTeam (source, getTeamFromName("Los Santos Crew")) outputChatBox("Bienvenido, Ahora perteneces Al gang (Los Santos Crew).",source,0,255,0) end ) Link to comment
Enargy, Posted November 20, 2016 Share Posted November 20, 2016 Colocaste 'gangster' sin la segunda G en el trigger. Link to comment
vinexX Posted November 24, 2016 Author Share Posted November 24, 2016 On 19/11/2016 at 7:27 PM, MarkFlash said: Cambie un poco de las funciones quizás te sirva para todo tus paneles.. Client: addEventHandler("onClientResourceStart", resourceRoot, function () ventana = guiCreateWindow(147, 212, 534, 273, "Selector de Teams | Street Gang", false) guiWindowSetSizable(ventana, false) botonlossantos = guiCreateButton(19, 58, 164, 45, "Los Santos Crew", false, ventana) guiSetFont(botonlossantos, "default-bold-small") guiSetProperty(botonlossantos, "NormalTextColour", "FFAAAAAA") addEventHandler("onClientGUIClick", botonlossantos, entrarTeam, false) botonballas = guiCreateButton(354, 58, 164, 45, "Ballas Street", false, ventana) guiSetFont(botonballas, "default-bold-small") guiSetProperty(botonballas, "NormalTextColour", "FFAAAAAA") botonvagos = guiCreateButton(190, 113, 164, 45, "The Vagos Blood", false, ventana) guiSetFont(botonvagos, "default-bold-small") guiSetProperty(botonvagos, "NormalTextColour", "FFAAAAAA") botonaztecas = guiCreateButton(354, 168, 164, 45, "Aztecas Family", false, ventana) guiSetFont(botonaztecas, "default-bold-small") guiSetProperty(botonaztecas, "NormalTextColour", "FFAAAAAA") botongrove = guiCreateButton(19, 168, 164, 45, "Groove Danger ", false, ventana) guiSetFont(botongrove, "default-bold-small") guiSetProperty(botongrove, "NormalTextColour", "FFAAAAAA") labeeel = guiCreateLabel(158, 223, 218, 15, "Selecciona El Team Que mas Te guste.", false, ventana) guiSetFont(labeeel, "default-bold-small") guiLabelSetColor(labeeel, 8, 114, 246) showCursor(true) end ) addEventHandler("onClientGUIClick", resourceRoot, function() if source == botonlossantos then triggerServerEvent("ganster",localPlayer) guiSetVisible(ventana, false) showCursor(false) --elseif source == botonballas then puedes poner los demás botones con el elseif source == variable then no es necedidad de crear muchos eventos con el onClientGUIClick. end end ) Server: gansta = createTeam ("Los Santos Crew", 6, 183, 248)addEventHandler("gangster", true)addEventHandler("gangster", root, function() setPlayerTeam (source, getTeamFromName("Los Santos Crew")) outputChatBox("Bienvenido, Ahora perteneces Al gang (Los Santos Crew).",source,0,255,0) end) Muchas Gracias!!! Link to comment
Recommended Posts