Jump to content

Mefisto_PL

Members
  • Posts

    460
  • Joined

  • Last visited

Everything posted by Mefisto_PL

  1. Mefisto_PL

    Horn

    Okey I'm fix that : > Close topic .
  2. Mefisto_PL

    Horn

    I want to create new horn and my code doesn't working Where is mistake? function createHorn ( ) local x, y, z = getElementPosition ( player ) local vehicle = getPedOccupiedVehicle ( player ) local sound = playSound3( "newhorn.mp3" ) setSoundVolume ( sound, 0.5 ) attachElements ( sound, vehicle ) end addCommandHandler("horn", createHorn) function onPlayerJoin() bindKey( source, "h", "both", createHorn ) end addEventHandler( "onPlayerJoin", root, onPlayerJoin ) addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function () for i,v in pairs(getElementsByType("player")) do bindKey(v,"h","both",createHorn) end end)
  3. Okey .. I fix that It's working ! But how can I change column height ( I mean label with nicks and ping etc. )
  4. So i send you ///EDIT Can I do anything to fix that?
  5. It doesn't helps.. and I put here everything what I have with data. setElementData( who, "avatar", loadPlayerData(who,"avatar") ) loadPlayerData(Who,"avatar") savePlayerData( Who, "avatar", id ) setElementData( Who, "avatar", id ) setElementData( Who, "avatar_file", ":Panel-F7/" .. file ) setElementData( Who, "avatar_file", ":Panel-F7/" .. file )
  6. if in dxscoreboard_client.lua is "avatar" show only column , but if is "Avatar" show avatar number.
  7. LOL It's shows avatar number.. not image.
  8. still doesn't show avatar Script.lua exports.scoreboard:addScoreboardColumn("Avatar", root, 1, 64) function showavatar() local avek_file = getElementData(source, "avatar_file") if avek_file then setElementData(source,"avatar",":Panel-F7/avatars/"..avek_file..".png") else setElementData(source,"avatar","N/A") end end addEventHandler("onPlayerJoin",root,showavatar) dxscoreboard_client.lua elseif column.name == "Avatar" then dxDrawImage( topX+theX, y+s(1), 16, 11, content, 0, 0, 0, cWhite, drawOverGUI) else dxDrawText( content, topX+theX+s(1), y+s(1), topX+x+s(1+column.width), y+s(11)+dxGetFontHeight( fontscale(contentFont, scoreboardScale), contentFont ), tocolor( 0, 0, 0, a or 255 ), fontscale(contentFont, s(1)), contentFont, "left", "top", true, false, drawOverGUI ) dxDrawText( content, topX+theX, y, topX+x+s(column.width), y+dxGetFontHeight( fontscale(contentFont, scoreboardScale), contentFont ), tocolor( r or 255, g or 255, b or 255, a or 255 ), fontscale(contentFont, s(1)), contentFont, "left", "top", true, false, drawOverGUI ) end
  9. You're my god :3 Thank You very much. Scoreboard It's working (YEAH), but doesn't show Avatar..
  10. Doesn't show anything I use debug : /
  11. Oh my fail. I change it to "if" but it doesn't helps
  12. It looks like this: (doesn't working ) else elseif column.name == "avatar" then dxDrawImage( topX+theX, y+s(1), 16, 11, content, 0, 0, 0, cWhite, drawOverGUI ) dxDrawText( content, topX+theX+s(1), y+s(1), topX+x+s(1+column.width), y+s(11)+dxGetFontHeight(fontscale(contentFont, scoreboardScale), contentFont ), tocolor( 0, 0, 0, a or 255 ), fontscale(contentFont, s(1)), contentFont, "left", "top", true, false, drawOverGUI ) dxDrawText( content, topX+theX, y, topX+x+s(column.width), y+dxGetFontHeight( fontscale(contentFont, scoreboardScale), contentFont ), tocolor( r or 255, g or 255, b or 255, a or 255 ), fontscale(contentFont, s(1)), contentFont, "left", "top", true, false, drawOverGUI ) end end Lines 704-710
  13. Another player wrote I must add it on line 705 but scoreboard doesn't working when I add this ..
  14. hmm I found it, I must add elseif column.name == "avatar" then dxDrawImage( topX+theX, y+s(1), 16, 11, content, 0, 0, 0, cWhite, drawOverGUI ) but i don't know when I must put this .
  15. I would like to make a show avatar in scoreboard, I search something to help and I wrote that, but it's make a column only and don't show a image.. exports.scoreboard:addScoreboardColumn('Avatar', getRootElement(), 64, 64) function showavatar() local avatar = getElementData( player, "avatar" ) if avek then local avek_file = getElementData( player, "avatar_file" ) setElementData(source,"avatar",":Panel-F7/avatars/"..avek_file..".png") else avek = "N/A" end end addEventHandler("onPlayerJoin",getRootElement(),showavatar)
  16. Put your code here and send url to us
  17. Hello, I have "firstperson" gamemode from community, but when I want start it (with dependencies), it's not working.. It's not working on 1.3 or what? Please, help me !
  18. Bazy: map editor. Chyba, że chodzi Ci o frakcje, wtedy będziesz potrzebował createTeam, aclGetGroup oraz setPlayerTeam. Co do spawn'u musisz użyć spawnPlayer. Uwierz. że to nie jest trudne. ; )
  19. Server: addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), call ( getResourceFromName ( "scoreboard" ), "scoreboardAddColumn", "Online" ) addEventHandler ( "onResourceStart" , resourceRoot , function ( ) for index , player in ipairs ( getElementsByType ( "player" ) ) do local pAccount = getPlayerAccount ( player ) if not isGuestAccount ( pAccount ) then local minutes = getAccountData ( pAccount , "Online.minutes" ) if minutes then local hours = getAccountData ( pAccount , "Online.hours" ) if # tostring ( minutes ) == 1 then minutes = "0" .. minutes end if # tostring ( hours ) == 1 then hours = "0" .. hours end setElementData ( player , "Online" , hours .. " H " .. minutes .. " M" ) local timer = setTimer ( updatePlayerOnline , 60000 , 1 , player ) setElementData ( player , "Online.timer" , timer ) else setAccountData ( pAccount , "Online.minutes" , 0 ) setAccountData ( pAccount , "Online.hours" , 0 ) setElementData ( player , "Online" , "00 H 00 M" ) local timer = setTimer ( updatePlayerOnline , 60000 , 1 , player ) setElementData ( player , "Online.timer" , timer ) end else setElementData ( player , "Online" , "N/A" ) end end end ) addEventHandler ( "onResourceStop" , resourceRoot , function ( ) for index , player in ipairs ( getElementsByType ( "player" ) ) do local pAccount = getPlayerAccount ( player ) if not isGuestAccount ( pAccount ) then local timer = getElementData ( player , "Online.timer" ) if isTimer ( timer ) then killTimer ( timer ) end end end end ) addEventHandler ( "onPlayerLogin" , root , function ( _ , pAccount ) local minutes = getAccountData ( pAccount , "Online.minutes" ) if minutes then local hours = getAccountData ( pAccount , "Online.hours" ) if # tostring ( minutes ) == 1 then minutes = "0" .. minutes end if # tostring ( hours ) == 1 then hours = "0" .. hours end setElementData ( source , "Online" , hours .. " H " .. minutes .. " M" ) local timer = setTimer ( updatePlayerOnline , 60000 , 1 , source ) setElementData ( source , "Online.timer" , timer ) else setAccountData ( pAccount , "Online.minutes" , 0 ) setAccountData ( pAccount , "Online.hours" , 0 ) setElementData ( source , "Online" , "00 H 00 M" ) local timer = setTimer ( updatePlayerOnline , 60000 , 1 , source ) setElementData ( source , "Online.timer" , timer ) end end ) addEventHandler ( "onPlayerLogout" , root , function ( pAccount ) local timer = getElementData ( source , "Online.timer" ) if isTimer ( timer ) then killTimer ( timer ) end end ) addEventHandler ( "onPlayerJoin" , root , function ( ) setElementData ( source , "Online" , "N/A" ) end ) addEventHandler ( "onPlayerQuit" , root , function ( ) local pAccount = getPlayerAccount ( source ) if not isGuestAccount ( pAccount ) then local timer = getElementData ( source , "Online.timer" ) if isTimer ( timer ) then killTimer ( timer ) end end end ) function updatePlayerOnline ( player ) local pAccount = getPlayerAccount ( player ) local minutes = getAccountData ( pAccount , "Online.minutes" ) local hours = getAccountData ( pAccount , "Online.hours" ) minutes = tostring ( tonumber ( minutes ) + 1 ) if minutes == "60" then hours = tostring ( tonumber ( hours ) + 1 ) minutes = "00" end setAccountData ( pAccount , "Online.minutes" , tonumber ( minutes ) ) setAccountData ( pAccount , "Online.hours" , tonumber ( hours ) ) if # tostring ( minutes ) == 1 then minutes = "0" .. minutes end if # tostring ( hours ) == 1 then hours = "0" .. hours end setElementData ( player , "Online" , hours .. " H " .. minutes .. " M" ) local timer = setTimer ( updatePlayerOnline , 60000 , 1 , player ) setElementData ( player , "Online.timer" , timer ) end It's Working in 100%. I was having this same problem
  20. mtapolska.com tu masz takie główne polskie forum o MTA , najbardziej znane, może tutaj coś znajdziesz, popytaj tam .
  21. http://pastebin.com/jxr4EgiE If it help..
  22. It's a fragment of code . ///EDIT In Debugscript Isn't any error.
  23. Hello, I've scoreboard edited by NexTreme and I want to create my own font in that, but when I upload it, it's not working.. nicksfont = dxCreateFont( "nicks.ttf", 20 ) useAnimation = settings.useanimation scoreboardIsToggleable = settings.toggleable showServerInfo = --[[settings.showserverinfo]] false showGamemodeInfo = --[[settings.showgamemodeinfo]] false showTeams = --[[settings.showteams]] true useColors =--[[ settings.usecolors]] true drawSpeed = settings.drawspeed scoreboardScale = settings.scale columnFont = "beckett" contentFont = nicksfont teamHeaderFont = "default-bold" serverInfoFont = "clear" Where is mistake?! :<
×
×
  • Create New...