Plate Posted January 27, 2013 Posted January 27, 2013 Hola tengo un problema con un mi script que me ayudo alex pero me da bad argument en getTeamFromName y en guiGridListGetItemText client function deteam() local team = guiGridListGetItemText(teamList, row, columnA) triggerServerEvent("Move", getLocalPlayer(), team) end addEventHandler("onClientGUIClick", mover, deteam, false) server function setTeam(player, teamName) local theTeam = getTeamFromName ( teamName ) if ( theTeam ) then setPlayerTeam ( player , theTeam ) end end addEvent("Move", true) addEventHandler("Move",getRootElement(), setTeam) Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted January 27, 2013 Posted January 27, 2013 function deteam ( ) local row, col = guiGridListGetSelectedItem ( teamList ) if ( row and col and row ~= -1 and col ~= -1 ) then local team = guiGridListGetItemText ( teamList, row, columnA ) triggerServerEvent ( "Move", localPlayer, localPlayer, team ) end end addEventHandler ( "onClientGUIClick", mover, deteam, false ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Plate Posted January 27, 2013 Author Posted January 27, 2013 Y para borrar un team es lo mismo solid? pero con un destroyElement en lugar del setPlayerTeam? Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted January 27, 2013 Posted January 27, 2013 Si. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Plate Posted January 27, 2013 Author Posted January 27, 2013 Me da bad argument en getTeamFromName server function borro() local theTeam = getTeamFromName ( teamName ) if ( theTeam ) then destroyElement(theTeam) end end addEvent("borro", true) addEventHandler("borro", getRootElement(), borro) client function borr ( ) local row, col = guiGridListGetSelectedItem ( teamList ) if ( row and col and row ~= -1 and col ~= -1 ) then local team = guiGridListGetItemText ( teamList, row, columnA ) triggerServerEvent ( "borro", localPlayer, localPlayer, team ) end end addEventHandler ( "onClientGUIClick", borrar, borr, false ) Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted January 27, 2013 Posted January 27, 2013 Primero: Quita uno de los 'localPlayer' de triggerServerEvent. Segundo: Te olvidaste de definir 'teamName' en al funcion 'borro'. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Alexs Posted January 27, 2013 Posted January 27, 2013 function borro(teamName) local theTeam = getTeamFromName ( teamName ) if ( theTeam ) then destroyElement(theTeam) end end addEvent("borro", true) addEventHandler("borro", getRootElement(), borro) function borr ( ) local row, col = guiGridListGetSelectedItem ( teamList ) if ( row and col and row ~= -1 and col ~= -1 ) then local team = guiGridListGetItemText ( teamList, row, columnA ) triggerServerEvent ( "borro", root, team ) end end addEventHandler ( "onClientGUIClick", borrar, borr, false ) Developer @ MYVAL
Plate Posted January 27, 2013 Author Posted January 27, 2013 Gracias alex y solid pero hay una cosa es que cuando borro el team todabia queda en la gridlist Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted January 27, 2013 Posted January 27, 2013 Usa guiGridListClear y luego pone los teams de nuevo. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Plate Posted January 27, 2013 Author Posted January 27, 2013 Listo muchas gracias!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! solid y alex!!!!!!!!!!!!!!!!! Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted January 27, 2013 Posted January 27, 2013 De nada. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Plate Posted January 27, 2013 Author Posted January 27, 2013 PD lo de la guiGridListClear no me funciono lo puse antes de lo de los teams y sigue sin andar Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted January 27, 2013 Posted January 27, 2013 Postea el codigo. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Plate Posted January 27, 2013 Author Posted January 27, 2013 guiGridListClear ( teamList ) for id, team in ipairs(getElementsByType("team")) do local row = guiGridListAddRow ( teamList ) guiGridListSetItemText ( teamList, row, columnA, getTeamName ( team ), false, false ) guiGridListSetItemColor ( teamList, row, columnA, getTeamColor ( team ) ) end Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Plate Posted January 27, 2013 Author Posted January 27, 2013 No es necesario Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted January 27, 2013 Posted January 27, 2013 guiGridListClear ( teamList ) for id, team in ipairs(getElementsByType("team")) do local row = guiGridListAddRow ( teamList ) guiGridListSetItemText ( teamList, row, columnA, getTeamName ( team ), false, false ) guiGridListSetItemColor ( teamList, row, columnA, getTeamColor ( team ) ) end Si esta todo bien puesto, deberia funcionar. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Plate Posted January 27, 2013 Author Posted January 27, 2013 Pero no me anda igual Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted January 27, 2013 Posted January 27, 2013 Postea todo el script o enviamelo por PM. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Plate Posted January 27, 2013 Author Posted January 27, 2013 Hya te lo mando por pm Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Recommended Posts