Jump to content

JunkDealer

Members
  • Posts

    35
  • Joined

  • Last visited

Everything posted by JunkDealer

  1. Try this: http://www.upload.ee/files/5370496/scoreboard.zip.html
  2. -- Message deleted. For any user it won't benefits anymore.
  3. -- Message deleted. For any user it won't benefits anymore.
  4. color done but now just unfreezing all. I mean, when press F5, unfreezing only. Players already unfreezed Edit: Fixed. Ty for help
  5. thx but color still not working and when press F5, just freezing some players. Not all
  6. I get some bugs. No error in debug but color is not working and sometimes when press F5 1 time, it is happening like press 2 or 3 times.
  7. Hi. I tried to make freeze alive players when admin/supermoderator/moderator press F5 but it is working sometimes. I mean, 1 map starting and pressing F5 and freezing all. Another map, pressing F5 and nothing happening. Or when press F5, writing in chat but not freezing. Can anyone help me to fix it? server.lua: local aclTable = {"Admin", "SuperModerator", "Moderator"} acik = 1 alivePlayers = getAlivePlayers () function isAdmin(thePlayer) local pAcc = getPlayerAccount(thePlayer) if isGuestAccount(pAcc) then return false end for _, anACL in ipairs(aclTable) do if isObjectInACLGroup('user.'..getAccountName(pAcc), aclGetGroup(anACL)) then return true end end return false end function toggleFreezeStatus ( thePlayer ) for i, thePlayer in ipairs(alivePlayers) do if getPedOccupiedVehicle ( thePlayer ) then local playerVehicle = getPlayerOccupiedVehicle ( thePlayer ) local currentFreezeStatus = isElementFrozen ( playerVehicle ) local newFreezeStatus = not currentFreezeStatus setElementFrozen ( playerVehicle, newFreezeStatus ) end end end function freez ( thePlayer ) local pName = getPlayerNametagText(thePlayer) if acik == 1 then outputChatBox("* All players has been freezed by " .. pName .. ".",root,255,0,0,true) acik = 0 elseif acik == 0 then outputChatBox("* All players has been unfreezed by " .. pName .. ".",root,0,255,0,true) acik = 1 end end for i, thePlayer in ipairs(alivePlayers) do if isAdmin(thePlayer) then bindKey (thePlayer, "F5", "down", toggleFreezeStatus ) bindKey(thePlayer, "F5", "down", freez) end end
  8. ty so much. with little changes, works perfect
  9. Hi. This is orjinal race's nametags.lua: nametag = {} 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.7 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 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 isPedDead(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 ) --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(r,g,0,0.4*alpha) ) --Finally, the actual health dxDrawRectangle ( drawX + outlineThickness, drawY + outlineThickness, health*(width - outlineThickness*2), height - outlineThickness*2, tocolor(r,g,0,alpha) ) end break end end 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 ) If player in team, his name color on car happening with team color. Example: [MTA]Player If player not in team, his name color on car happening white. [MTA]Player I want to make it, if in team [MTA]Player so tag will be team color, player name will be player's own color. If not in team [MTA]Player tag will be white and player name will be player's own color. I tried to make it but I couldn't If anyone help me for that, I will be thankful.
  10. Hi. I have redirect panel to join another server. It is working fine. I want to add other server's number of online players and map name to panel but idk where can start or what should I do.. Someone can help me?
  11. ty for help. I tried this but it doesn't work. function remWheel ( sourcePlayer ) theVehicle = getPlayerOccupiedVehicle ( sourcePlayer ) if ( theVehicle ) then removeVehicleUpgrade ( theVehicle, 1085 ) end end I did this, started map (with map 1085 id wheel is coming) but nothing changed. Can you tell me more wide?
  12. Hi. I have DD server and I need help about wheels. Almost in all maps we are using Cheetah and as everyone know every map car's wheels changing. I want to make it start with default wheel. Like this: http://mahiwaga.com/img.jpg I mean other uprages will stay but every map car will start with default wheel. I hope you understand me and anyone can help me. Thx..
  13. -- Message deleted. For any user it won't benefits anymore.
  14. -- Message deleted. For any user it won't benefits anymore.
  15. JunkDealer

    Voice

    -- Message deleted. For any user it won't benefits anymore.
  16. JunkDealer

    Voice

    -- Message deleted. For any user it won't benefits anymore.
  17. -- Message deleted. For any user it won't benefits anymore.
  18. -- Message deleted. For any user it won't benefits anymore.
  19. -- Message deleted. For any user it won't benefits anymore.
  20. -- Message deleted. For any user it won't benefits anymore.
  21. -- Message deleted. For any user it won't benefits anymore.
×
×
  • Create New...