Hab ich bereits so.
Beiträge von EroX
-
-
Externer Inhalt lzy.ccInhalte von externen Seiten werden ohne Ihre Zustimmung nicht automatisch geladen und angezeigt.Lua
[2013-02-03 17:56:41] start: Requested by Console [2013-02-03 17:56:41] start: Resource is already running
//edit:
@Unicom-Reallife:
Lesen wäre von Vorteil. Der Fehler tritt auf, wenn er den Server stoppt... Vorher geht alles.Exakt
-
...
Aber wenn sie nicht gestartet wäre, dann hätte er mir im Betrieb schon Errors ausgespuckt...
Ich schätze die Ressource wird beim beenden zu früh beendet, weil andere Ressourcen diese noch benötigen beim herunterfahren...? -
starte die resource mapmanager btw mach die in der mtaserver.conf
Ähm, hast du meinen Beitrag gelesen?
Die Resource ist gestartet...der Error tritt nur beim beenden des Servers auf. -
Folgende Fehlermeldungen erhalte ich, wenn ich den Server beende, wie kann ich das beheben?
Ich muss mit Sicherheit die Reihenfolge der zu beendenden Ressourcen ändern oder? - Wie muss ich vorgehen?Lua[2013-02-03 17:01:37] Server stopped! [2013-02-03 17:01:38] Stopping resources.............. [2013-02-03 17:01:38] ERROR: exports: Call to non-running server resource (mapmanager) [string "?"] [2013-02-03 17:01:38] INFO: Resource stopping [2013-02-03 17:01:38] ERROR: exports: Call to non-running server resource (mapmanager) [string "?"] [2013-02-03 17:01:38] ERROR: exports: Call to non-running server resource (mapmanager) [string "?"] [2013-02-03 17:01:38] ERROR: exports: Call to non-running server resource (mapmanager) [string "?"]
Gruß
-
/CloseReq.
Alles selber herausgefunden und gefixxt - ist fertig.
Und was hast du jetzt genau gemacht?
-
Okay, bedanke mich.
MfG -
Lua
--dxDrawText ( getPlayerName(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default", "center", "bottom", false, false, false ) dxDrawText ( getPlayerName(player), sx + 1, sy - offset + 1, sx + 1, sy - offset + 1, tocolor(0,0,0,255), textscale*NAMETAG_TEXTSIZE, "bankgothic", "center", "bottom", false, false, false )
Diese hier?
-
Mein Problem ist, dass ich nicht weiß welche Zeile es ist.
-
Externer Inhalt lzy.ccInhalte von externen Seiten werden ohne Ihre Zustimmung nicht automatisch geladen und angezeigt.Lua
Alles anzeigennametag = {} local nametags = {} local g_screenX,g_screenY = guiGetScreenSize() local bHideNametags = false local NAMETAG_SCALE = 0.3 --Overall adjustment of the nametag, use this to resize but constrain proportions local NAMETAG_ALPHA_DISTANCE = 50 --Distance to start fading out local NAMETAG_DISTANCE = 120 --Distance until we're gone local NAMETAG_ALPHA = 120 --The overall alpha level of the nametag --The following arent actual pixel measurements, they're just proportional constraints local NAMETAG_TEXT_BAR_SPACE = 2 local NAMETAG_WIDTH = 50 local NAMETAG_HEIGHT = 5 local NAMETAG_TEXTSIZE = 0.3 local NAMETAG_OUTLINE_THICKNESS = 1.2 -- local NAMETAG_ALPHA_DIFF = NAMETAG_DISTANCE - NAMETAG_ALPHA_DISTANCE NAMETAG_SCALE = 1/NAMETAG_SCALE * 800 / g_screenY -- Ensure the name tag doesn't get too big local maxScaleCurve = { {0, 0}, {3, 3}, {13, 5} } -- Ensure the text doesn't get too small/unreadable local textScaleCurve = { {0, 0.8}, {0.8, 1.2}, {99, 99} } -- Make the text a bit brighter and fade more gradually local textAlphaCurve = { {0, 0}, {25, 100}, {120, 190}, {255, 190} } function nametag.create ( player ) nametags[player] = true end function nametag.destroy ( player ) nametags[player] = nil end ---------------THE FOLLOWING IS THE MANAGEMENT OF NAMETAGS----------------- addEventHandler('onClientResourceStart', g_ResRoot, function() for i,player in ipairs(getElementsByType"player") do if player ~= g_Me then nametag.create ( player ) end end end ) addEventHandler ( "onClientPlayerJoin", g_Root, function() if source == g_Me then return end setPlayerNametagShowing ( source, false ) nametag.create ( source ) end ) addEventHandler ( "onClientPlayerQuit", g_Root, function() nametag.destroy ( source ) end ) addEvent ( "onClientScreenFadedOut", true ) addEventHandler ( "onClientScreenFadedOut", g_Root, function() bHideNametags = true end ) addEvent ( "onClientScreenFadedIn", true ) addEventHandler ( "onClientScreenFadedIn", g_Root, function() bHideNametags = false end ) addEventHandler ( "onClientRender", g_Root, function() -- Hideous quick fix -- for i,player in ipairs(g_Players) do if player ~= g_Me then setPlayerNametagShowing ( player, false ) if not nametags[player] then nametag.create ( player ) end end end if bHideNametags then return end local x,y,z = getCameraMatrix() for player in pairs(nametags) do while true do if not isPedInVehicle(player) or isPlayerDead(player) then break end local vehicle = getPedOccupiedVehicle(player) local px,py,pz = getElementPosition ( vehicle ) local pdistance = getDistanceBetweenPoints3D ( x,y,z,px,py,pz ) if pdistance <= NAMETAG_DISTANCE then --Get screenposition local sx,sy = getScreenFromWorldPosition ( px, py, pz+0.95, 0.06 ) if not sx or not sy then break end --Calculate our components local scale = 1/(NAMETAG_SCALE * (pdistance / NAMETAG_DISTANCE)) local alpha = ((pdistance - NAMETAG_ALPHA_DISTANCE) / NAMETAG_ALPHA_DIFF) alpha = (alpha < 0) and NAMETAG_ALPHA or NAMETAG_ALPHA-(alpha*NAMETAG_ALPHA) scale = math.evalCurve(maxScaleCurve,scale) local textscale = math.evalCurve(textScaleCurve,scale) local textalpha = math.evalCurve(textAlphaCurve,alpha) local outlineThickness = NAMETAG_OUTLINE_THICKNESS*(scale) --Draw our text local r,g,b = 255,255,255 local team = getPlayerTeam(player) if team then r,g,b = getTeamColor(team) end local offset = (scale) * NAMETAG_TEXT_BAR_SPACE/2 --dxDrawText ( getPlayerName(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default", "center", "bottom", false, false, false ) dxDrawText ( getPlayerName(player), sx + 1, sy - offset + 1, sx + 1, sy - offset + 1, tocolor(0,0,0,255), textscale*NAMETAG_TEXTSIZE, "bankgothic", "center", "bottom", false, false, false ) dxDrawColorText( getPlayerNametagText(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, 'bankgothic', 'center', 'bottom' ) --We draw three parts to make the healthbar. First the outline/background local drawX = sx - NAMETAG_WIDTH*scale/2 drawY = sy + offset local width,height = NAMETAG_WIDTH*scale, NAMETAG_HEIGHT*scale dxDrawRectangle ( drawX, drawY, width, height, tocolor(0,0,0,alpha) ) --Next the inner background local health = getElementHealth(vehicle) health = math.max(health - 250, 0)/750 local p = -510*(health^2) --local r,g = math.max(math.min(p + 255*health + 255, 255), 0), math.max(math.min(p + 765*health, 255), 0) dxDrawRectangle ( drawX + outlineThickness, drawY + outlineThickness, width - outlineThickness*2, height - outlineThickness*2, tocolor(178,178,178,0.4*alpha) ) --Finally, the actual health dxDrawRectangle ( drawX + outlineThickness, drawY + outlineThickness, health*(width - outlineThickness*2), height - outlineThickness*2, tocolor(r,g,b,alpha) ) end break end end end ) function dxDrawColorText(str, ax, ay, bx, by, color, scale, font, alignX, alignY) if alignX then if alignX == "center" then local w = dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font) ax = ax + (bx-ax)/2 - w/2 elseif alignX == "right" then local w = dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font) ax = bx - w end end if alignY then if alignY == "center" then local h = dxGetFontHeight(scale, font) ay = ay + (by-ay)/2 - h/2 elseif alignY == "bottom" then local h = dxGetFontHeight(scale, font) ay = by - h end end local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), 255) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) ax = ax + w color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), 255) end last = e + 1 s, e, cap, col = str:find(pat, last) end if last <= #str then cap = str:sub(last) local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) end end
-
Bin auch an dem Script interessiert.
-
Echt heftig, was man alles aus dem alten Spiel rausholen kann.
-
Der auf dem Foto könnte dich anzeigen, dies ist dir doch bewusst oder?
(Recht am eigenen Bild)MfG
-
Ich habe hier ein Script, welches die Spielzeit des Spieler im Scoreboard anzeigt. Es funktioniert wunderbar, nur leider teilt das Script die Minuten nicht in Stunden auf.
Normalerweise sollte es so aussehen: H:M (Stunden:Minuten), wie gesagt teilt das Script die Minuten aber nicht in Stunden auf, das sieht dann so aus: '0:240', sollte aber so aussehen: '4:0', hoffe ihr versteht, was ich meine.Hier der Code:
Spoiler anzeigen
Lua
Alles anzeigenexports.scoreboard:addScoreboardColumn( 'Playtime' ) local t = { } local uTimers = { } function checkValues( source,arg1,arg2 ) if arg1 > 60 then t[ source ][ 'min' ] = tonumber( t[ source ][ 'min' ] or 0 ) + 1 t[ source ][ 'sec' ] = 0 elseif arg2 > 3600 then t[ source ][ 'sec' ] = 0 t[ source ][ 'min' ] = 0 t[ source ][ 'hour' ] = tonumber( t[ source ][ 'hour' ] or 0 ) + 1 end end function onPlayerLogOut ( _,account ) if ( account ) and not isGuestAccount ( account ) then local sValue = getElementData( source,'Playtime' ) setAccountData ( account, "Playtime", tostring( sValue ) ) end if isTimer( uTimers[ source ] ) then killTimer( uTimers[ source ] ) end uTimers[ source ] = nil t[ source ] = nil end function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local sValue = getElementData( source,'Playtime' ) setAccountData ( playeraccount, "Playtime", tostring( sValue ) ) end if isTimer( uTimers[ source ] ) then killTimer( uTimers[ source ] ) end uTimers[ source ] = nil t[ source ] = nil end function subFind( str,mod ) if mod == 'hour' then return str:sub( 1,str:find( ':' ) -1 ) else return str:sub( str:find( ':' ) + 1,str:len( ) ) end end function onPlayerLogin (_, account ) if account then uTimers[ source ] = setTimer( function( player,acc ) local time = getAccountData ( acc, "Playtime" ) if time then if not t[ player ] then t[ player ] = { ["hour"] = tonumber( subFind( time,'hour' ) ), ["min"] = tonumber( subFind( time ) ), ["sec"] = 0 } end else if not t[ player ] then t[ player ] = { ["hour"] = 0, ["min"] = 0, ["sec"] = 0 } end end t[ player ][ 'sec' ] = tonumber( t[ player ][ 'sec' ] or 0 ) + 1 checkValues ( player, t[ player ][ 'sec' ] or 0, t[ player ][ 'min' ] or 0 ) setElementData ( player, "Playtime", tostring( t[ player ][ 'hour' ] or 0 )..':'..tostring( t[ player ][ 'min' ] or 0 ) ) end, 1000, 0 ,source,account ) end end addEventHandler ( "onPlayerQuit", root, onPlayerQuit ) addEventHandler ( "onPlayerLogin", root, onPlayerLogin ) addEventHandler( 'onPlayerLogout',root, onPlayerLogOut )
Wäre dankbar, wenn mir jemand helfen würde.
//edit: Rechtschreibfehler
-
Alles klar, genau das wollte ich.
Danke -
Achso und den Wert '2500' entsprechend auf '0' setzen, damit das Bild wieder erscheint?
Danke schonmal für die blitzschnelle Hilfe.MfG
-
Ich wollte mal kurz fragen, wie ich das umsetzen kann, dass das Bild nach dem Tot langsam schwarz wird.
Würde mich sehr freuen, wenn mir jemand helfen könnte.MfG
-
Gefällt mir
Nette Idee.^^ -
Hallo,
Ich bin dabei eine MapInfo für meinen Race-Server zu erstellen, welche beim Mapstart erscheinen soll, am besten mit einer Animation, wie kann ich das gestalten?
Mein Code sieht momentan so aus (Bin Neuling):Lualocal screenWidth, screenHeight = guiGetScreenSize() local x = screenWidth/1.2 local y = screenHeight/5 anzeige = dxDrawText("Map:"..mapInfo.name,x,y,screenWidth/1.1,y,tocolor(0,125,0),1.5,"diploma","right","center"
Wäre dankbar, wenn mir jemand hilft. (:
Mit freundlichen Grüßen
EroX -
Danke, funktioniert!
Mit freundlichen Grüßen
EroX