Daniel1zD Posted December 8, 2013 Share Posted December 8, 2013 tengo un problema no sale la imagen en el score no se cual es el problema por favor ayuda solo se crea el espacio en el score pero no aparese nada mas function medalla() setElementData ( player, "rango", "imajen/1.png" ) setElementData ( player, "rango", "imajen/1.png" ) end addCommandHandler ( "giverango", medalla ) function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local imajen = getElementData(source,"Rango") setAccountData ( playeraccount, "Rango", imajen ) end end function onPlayerLogin ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local imajen = getAccountData ( playeraccount, "Rango" ) if ( imajen ) then setElementData ( source, "Rango", imajen ) end end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) addEventHandler ( "onPlayerLogout", getRootElement ( ), onPlayerQuit ) addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin ) exports.scoreboard:addScoreboardColumn('Rango',getRootElement(),1,70,'Rango') Link to comment
MTA Team 0xCiBeR Posted December 8, 2013 MTA Team Share Posted December 8, 2013 No defines Player..Además usas un Element Data incorrecto: PD:Modifique un poco tu script para hacerlo mas funcional.. function medalla(_,_,quien,medalla) local rango = tonumber(medalla) local destino = getPlayerFromNamePart(quien) setElementData ( destino, "Rango", "imajen/".. rango..".png" ) end --El comando seria /giverango [PARTEDELNOMBRE] [N° DE MEDALLA] addCommandHandler ( "giverango", medalla ) --Utiles function getPlayerFromNamePart(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end -- function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local imajen = getElementData(source,"Rango") setAccountData ( playeraccount, "Rango", imajen ) end end function onPlayerLogin ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local imajen = getAccountData ( playeraccount, "Rango" ) if ( imajen ) then setElementData ( source, "Rango", imajen ) end end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) addEventHandler ( "onPlayerLogout", getRootElement ( ), onPlayerQuit ) addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin ) exports.scoreboard:addScoreboardColumn('Rango',getRootElement(),1,70,'Rango') Link to comment
Daniel1zD Posted December 9, 2013 Author Share Posted December 9, 2013 a hora aparese el nombre dela carpeta dela imajen y el nombre dela imajen pero no se muestra la imajen :c Link to comment
MTA Team 0xCiBeR Posted December 9, 2013 MTA Team Share Posted December 9, 2013 a hora aparese el nombre dela carpeta dela imajen y el nombre dela imajen pero no se muestra la imajen :c Debes editar el resource del scoreboard en dxscoreboard_client.lua para que acepte imagenes..Hay varios topics en el foro de como hacerlo.. Suerte! PD: Tu script se parece bastante al script beta que hize para PDz..Y que luego se distribuyo sin mi permiso.. Link to comment
Daniel1zD Posted December 9, 2013 Author Share Posted December 9, 2013 Tienes razon ^^ gracias Link to comment
Daniel1zD Posted December 9, 2013 Author Share Posted December 9, 2013 PD: Tu script se parece bastante al script beta que hize para PDz..Y que luego se distribuyo sin mi permiso.. nunca supe de eso pero las funciones las saque de wiki https://wiki.multitheftauto.com/wiki/OnPlayerQuit https://wiki.multitheftauto.com/wiki/SetElementData Link to comment
MTA Team 0xCiBeR Posted December 9, 2013 MTA Team Share Posted December 9, 2013 Tienes razon ^^ gracias De nada ^^ Link to comment
Recommended Posts