Arsilex Posted April 3, 2012 Share Posted April 3, 2012 Hola alguen me puede decir que evento se utiliza para cojer las banderas del admin y ponerlas en tab? Link to comment
Edikosh998 Posted April 3, 2012 Share Posted April 3, 2012 Hola alguen me puede decir que evento se utiliza para cojer las banderas del admin y ponerlas en tab? Las banderas de los paises? Link to comment
Castillo Posted April 3, 2012 Share Posted April 3, 2012 Si, eso quiere el. @Pekio: Proba este recurso: https://community.multitheftauto.com/index.php?p= ... ls&id=3580 Link to comment
Arsilex Posted April 3, 2012 Author Share Posted April 3, 2012 no yo no quero el script ese cambia el admin y no por que carga mucho despues tengo esto exports.scoreboard:addScoreboardColumn('Country') exports.scoreboard:addScoreboardColumn('Home') function showHome () local Home = call(getResourceFromName("admin"), "getPlayerCountry", source) setElementData(source,"Country",Home) end addEventHandler("onPlayerJoin",getRootElement(),showHome) lo quero que me digan que llamada tengo que poner ._. Link to comment
Castillo Posted April 3, 2012 Share Posted April 3, 2012 El scoreboard no soporta imagenes, tenes que editar el recurso. Link to comment
Arsilex Posted April 3, 2012 Author Share Posted April 3, 2012 am Edit: olle y para añadir delante del nombre ID del personaje por ejemplo cuando alguen entre el primero de todos que le den id 1 y asi como se aria? Link to comment
Castillo Posted April 3, 2012 Share Posted April 3, 2012 Tenes que crear tu propio sistema, podes buscar aca: https://community.multitheftauto.com/, talvez alguien subio algo asi. Link to comment
Arsilex Posted April 3, 2012 Author Share Posted April 3, 2012 local optimize = true -- Should the script be optimized? (if optimized, cannot be used client-side) local ids = {} function assignID() for i=1,getMaxPlayers() do if not ids[i] then ids[i] = source setElementData(source,"id",i,not optimize) break end end end addEventHandler("onPlayerJoin",root,assignID) function startup() for k, v in ipairs(getElementsByType("player")) do local id = getElementData(v,"id") if id then ids[id] = v end end end addEventHandler("onResourceStart",resourceRoot,startup) function getPlayerID(player) for k, v in ipairs(ids) do if v == player then return k end end end function freeID() local id = getElementData(source,"id") if not id then return end ids[id] = nil end addEventHandler("onPlayerQuit",root,freeID) function getPlayerByID(id) local player = ids[id] return player or false end ese sirve? Link to comment
Edikosh998 Posted April 3, 2012 Share Posted April 3, 2012 Fijate haciendo exports.scoreboard:addScoreboardColumn('ID') function agregarID() for i,v in ipairs(getElementsByType("player")) do local id = getPlayerID(v) setElementData(v,"ID",id) end end addEventHandler("onResourceStart",getRootElement(),agregarID) -- No se si esta bien, sino la otra es function agregarIDenJoin() local id = getPlayerID(source) setElementData(source,"ID",id) end addEventHandler("onPlayerJoin",getRootElement(),agregarIDenJoin) La segunda estoy seguro que debe funcionar, la primera no se porque puede ser que la data se le setea a todos y no uno a cada uno. Link to comment
Arsilex Posted April 4, 2012 Author Share Posted April 4, 2012 no va tio aparece la tabla ID pero no sale nada Link to comment
Edikosh998 Posted April 4, 2012 Share Posted April 4, 2012 Sorry, despues de testear me funciono haciendo esto... Pones ese script de la community que posteastes aqui : local optimize = true -- Should the script be optimized? (if optimized, cannot be used client-side) local ids = {} exports.scoreboard:scoreboardAddColumn( "ID",90 ) -- La columna de ID function assignID() for i=1,getMaxPlayers() do if not ids[i] then ids[i] = source setElementData(source,"id",i,not optimize) setElementData(source,"ID",i) -- Cuando entra al juego, se le asigna la ID break end end end addEventHandler("onPlayerJoin",root,assignID) function startup() for k, v in ipairs(getElementsByType("player")) do local id = getElementData(v,"id") if id then ids[id] = v end end end addEventHandler("onResourceStart",resourceRoot,startup) function getPlayerID(player) for k, v in ipairs(ids) do if v == player then return k end end end function freeID() local id = getElementData(source,"id") if not id then return end ids[id] = nil end addEventHandler("onPlayerQuit",root,freeID) function getPlayerByID(id) local player = ids[id] return player or false end Ahi puse los comentarios de lo que cambie Ojala te sirva Link to comment
Edikosh998 Posted April 4, 2012 Share Posted April 4, 2012 nada sigue sin ir Lo probe.... Pone el script + meta en server y te tiene que funcionar... Link to comment
Recommended Posts