Jump to content

MrXz

Members
  • Posts

    127
  • Joined

  • Last visited

Everything posted by MrXz

  1. Hi all! Well, I was looking to do so you can create a dxDrawColorText when a map is not in nextmap, wanted to know how to do that when you put 'NEXTMAP' appears below the 'MAP' and the MAP up a bit up or else, it then appears above the 'MAP' only when i put a nextmap. and after playing, it disappears. I did this script g_NextMap = "- Not Set -" function setNextMap ( mapname ) g_NextMap = mapname end addEvent ( "setNextMap", true ) addEventHandler ( "setNextMap", getRootElement(), setNextMap ) function setNextNil ( dis ) g_NextMap = "- Not Set -" end addEvent ( "setNextNil", true ) addEventHandler ( "setNextNil", getRootElement(), setNextNil ) function hudSet () local screenWidth, screenHeight = guiGetScreenSize() if (g_NextMap) then dxDrawColorText ('#00A2FFNextmap: #FFFFFF' .. g_NextMap, 2, screenHeight - dxGetFontHeight(1.7, 'default-bold')/2, 100, 100, tocolor ( 255, 255, 255, 255 ), 1, 'default-bold', 1, 'left') else dxDrawColorText ('#00A2FFNextmap: #FFFFFFNO SET NEXTMAP', 2+1, screenHeight - dxGetFontHeight(0.0, 'default-bold')/2+1, 100+1, 100+1, tocolor ( 255, 255, 255, 255 ), 1, 'default-bold', 1, 'left') but before that I found this Please, help D:
  2. MrXz

    Problema y Dudas

    Bueno, gracias igualmente
  3. MrXz

    Problema y Dudas

    Mmmm.. la verdad es que nose que significa "triggear", o me olvide ;s Será esto? g_NextMap = "- Not Set -" function setNextMap ( mapname ) g_NextMap = mapname end addEvent ( "setNextMap", true ) addEventHandler ( "setNextMap", getRootElement(), setNextMap ) function setNextNil ( dis ) g_NextMap = "- Not Set -" end addEvent ( "setNextNil", true ) addEventHandler ( "setNextNil", getRootElement(), setNextNil )
  4. MrXz

    Problema y Dudas

    Si me funciono, solo que falto eliminar esto: 2, screenHeight - dxGetFontHeight(1.7, 'default-bold')/2 Bueno, para finalizar, como puedo crear otro dxDrawColorText, osea cuando no se setee ningún mapa, no aparezca nada y cuando se setee un map, el nextmap aparezca. Hize esto, pero no funciona. function setNextNil ( dis ) g_NextMap = "- Not Set -" end addEvent ( "setNextNil", true ) addEventHandler ( "setNextNil", getRootElement(), setNextNil ) function hudSet () local screenWidth, screenHeight = guiGetScreenSize() if (g_NextMap) then dxDrawColorText ('#00A2FFNextmap: #FFFFFF' .. g_NextMap, 2, screenHeight - dxGetFontHeight(1.7, 'default-bold')/2, 100, 100, tocolor ( 255, 255, 255, 255 ), 1, 'default-bold', 1, 'left') else dxDrawColorText ('#00A2FFNextmap: #FFFFFFNo seteado', 2+1, screenHeight - dxGetFontHeight(3.3, 'default-bold')/2+1, 100+1, 100+1, tocolor ( 255, 255, 255, 255 ), 1, 'default-bold', 1, 'left')
  5. MrXz

    Problema y Dudas

    Lo modifique, ahora no sale nada. Agrego el screenWidth y no aparece nada. Verdad, para que sirve el screenWidth Yo solo quiero poner los Spectators y FPS en medio de la pantalla ._.
  6. Muchas Gracias @Solidsnake14
  7. MrXz

    Problema y Dudas

    Entonces puedo hacer esto, por ejemplo? dxDrawColorText ('#00A2FFNextmap: #FFFFFF' .. g_NextMap,1, screenWidth, 2, screenHeight - dxGetFontHeight(1.7, 'default-bold')/2, 100, 100, tocolor ( 255, 255, 255, 255 ), 0.9, 'default-bold', 0.9, 'left')
  8. MrXz

    Problema y Dudas

    y esto para que sirve? no sera el ancho? screenWidth
  9. Buenas, bueno solo tengo una pequeña duda, cuales son las coodenadas de X y Y en el script para mover el texto "Nextmap, Map, Spectators y FPS" porque solo puedo mover de arriba para abajo del lado izquierdo. ¿Como puedo hacer eso? function hudSet () local screenWidth, screenHeight = guiGetScreenSize() dxDrawColorText ('#00A2FFNextmap: #FFFFFF' .. g_NextMap, 2, screenHeight - dxGetFontHeight(1.7, 'default-bold')/2, 100, 100, tocolor ( 255, 255, 255, 255 ), 0.9, 'default-bold', 0.9, 'left') if (g_MapInfo) then dxDrawColorText ('#00A2FFMap: #FFFFFF' .. g_MapInfo.name, 2, screenHeight - dxGetFontHeight(3.3, 'default-bold')/2, 100, 100, tocolor ( 255, 255, 255, 255 ), 0.9, 'default-bold', 0.9, 'left') else dxDrawColorText ('#00A2FFMap: #FFFFFF- Nothing -', 2+1, screenHeight - dxGetFontHeight(3.3, 'default-bold')/2+1, 100+1, 100+1, tocolor ( 255, 255, 255, 255 ), 0.9, 'default-bold', 0.9, 'left') end dxDrawColorText ('#00A2FFSpectators: #FFFFFF' .. #Spectators .. '', 2, screenHeight - dxGetFontHeight(1.7, 'default-blod')/2+1, 100+1, 100+1, tocolor ( 255, 255, 255, 255 ), 0.9, 'default-bold', 5, 'left') if getElementData(getLocalPlayer(),"fps") then dxDrawColorText ('#00A2FFFPS: #FFFFFF' .. getElementData(getLocalPlayer(),"fps"), 1.2, screenHeight - dxGetFontHeight(6.5, 'default-bold')/2, 100, 100, tocolor ( 255, 255, 255, 255 ), 0.9, 'default-bold', 0.9, 'left') else dxDrawColorText ('#00A2FFFPS: #FFFFFF??', 1.6, screenHeight - dxGetFontHeight(6.5, 'default-bold')/2, 100, 100, tocolor ( 255, 255, 255, 255 ), 0.9, 'default-bold', 0.9, 'left') end end
  10. Pues bien, mejor para no estar modificando el script, busque otro en la comunidad, encontre esto. ---------------do not change or touch this---------- Names={} Tags={} Colors={} ACL={} -------------------------------------------------------------- ---------------------------here put your clans read readme for instructions--------------------------------------- local names ={} local tags ={} local colors ={} local acls={} -------- load------------ function loadTeams() for i,name in pairs(names) do Names[i]=name end for i,tag in pairs(tags) do Tags[i]=tag end for i,color in pairs(colors) do Colors[i] = color end for i,acl in pairs(acls) do ACL[i] = acl end end addEventHandler("onResourceStart",getRootElement(),loadTeams) --------------------------------------------------- ----- move on start------------------ function moveOnStart() for i,player in pairs(getElementsByType("player")) do check(player) end end addEventHandler("onResourceStart",getRootElement(),moveOnStart) ------------------------------------------------------------------------- -----------check---------------------------- function check (player) setPlayerTeam(player,nil) for i,tag in pairs(tags) do if string.find(getPlayerName(player),tag) then local account=getPlayerAccount(player) if ACL[i]~="none" and not isObjectInACLGroup ( "user." ..getAccountName(account) , aclGetGroup ( ACL[i] ) ) then return end local name = Names[i] local color = Colors[i] if not getTeamFromName(name) then createTeam(name,getColorFromString(color)) end local team = getTeamFromName(name) setPlayerTeam(player,team) end end end -------------------------------- ----------remove Empty Team ---------- function remove() for t,teams in pairs(names) do local team = getTeamFromName(teams) if team then if countPlayersInTeam ( team )==0 then destroyElement(team) end end end end ----------------------------------------------------- -------NickChange------------- function nick(old,new) setTimer(check,1000,1,source) setTimer(remove,1500,1) end addEventHandler("onPlayerChangeNick",getRootElement(),nick) --------------------------------------------- -------Join-------------------------------- function join() setTimer(check,4000,1,source) end addEventHandler("onPlayerJoin",getRootElement(),join) ------------------------------- ---------Quit--------------------- function quit(player) setTimer(remove,1000,1) end addEventHandler("onPlayerQuit",getRootElement(),quit) ------------------------------------ ---------Login--------------------- function login() setTimer(check,1000,1,source) setTimer(remove,1500,1) end addEventHandler("onPlayerLogin",getRootElement(),login) ------------------------------------ ---------Logout--------------------- function logout() setTimer(check,1000,1,source) setTimer(remove,1500,1) end addEventHandler("onPlayerLogout",getRootElement(),logout) ------------------------------------ ----------blip-------------- function blip(player) local team = getPlayerTeam(player) if team then for v,blip in pairs(getAttachedElements(player)) do if getElementType(blip)=="blip" then local r,g,b =getTeamColor(team) setBlipColor(blip,r,g,b,255) end end end end function timer() setTimer(blip,3000,1,source) end addEventHandler("onPlayerSpawn",getRootElement(),timer) Pero en esta parte quiero crear mi clan y otros clanes. local names ={"MI CLAN","-For Example2-} local tags ={"MC","TZ"} local colors ={"#00ffff","#FF0000} local acls={"Admin","SuperModerators","Everyone"} --- Pero si solo quiero que entre mi clan y mi clan tiene Smod y Admin, lo pruebo y sale error. Tiene algun problema?, no sale nada en debugscript3, solo sale mensajes del admin en problemas de ACL
  11. Hola ! Bueno, quería saber, usando este script, como añadir un team mas pero usando un TAG, este script lo uso para mi clan osea todos los de mi clan tienen Admin y Smod, pero ahora quiero añadir otro clan pero usando el tag del clan, la verdad es que tuve una idea, pero no corrió el script. Alguna idea?, Por favor :c teamAdmin = createTeam ( "Clan", 0,124,255 ) teamDonador = createTeam ( "Donators", 107,255,0 ) function addtoteam(player) if isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(player)) , aclGetGroup ( "Admin" ) ) then setPlayerTeam ( player,teamAdmin ) elseif isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(player)) , aclGetGroup ( "SuperModerator" ) ) then setPlayerTeam ( player,teamAdmin ) elseif isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(player)) , aclGetGroup ( "moderator" ) ) then setPlayerTeam ( player,teamAdmin ) elseif isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(player)) , aclGetGroup ( "mod" ) ) then setPlayerTeam ( player,teamAdmin ) elseif isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(player)) , aclGetGroup ( "Donadores" ) ) then setPlayerTeam ( player,teamDonador ) end end function addtoteamtimer() setTimer(addtoteam,3000,1,source) end addEventHandler("onPlayerLogin",getRootElement(),addtoteamtimer)
  12. MrXz

    Help BuyMap

    Is the panel buy map Line 3894 for i,resource in ipairs(exports.mapmanager:getMapsCompatibleWithGamemode(getThisResource())) do
  13. MrXz

    Help BuyMap

    Hi all I recently did this script and not which is the error Please Help D: i would greatly appreciate --------------------------------------- -------------- BUY - MAP -------------------- function mapsList() local resourceTable = getResources() for resourceKey, resourceValue in ipairs(resourceTable) do local name = getResourceInfo(resourceValue, 'name') local type = getResourceInfo(resourceValue, 'type') local game = getResourceInfo(resourceValue, 'gamemodes') local author = getResourceInfo(resourceValue, 'author') if type == 'map' and game == 'race' then triggerClientEvent('sendMaps', getRootElement(), name, author) else cancelEvent() end end end addEvent('getMaps', true) addEventHandler('getMaps', getRootElement(), mapsList) addEvent('buyMapFromPanel', true) function buyMFP(mapname) if g_ForcedNextMap then outputChatBox('#00FF90[shop]#f1f1f1Next map is '..getMapName(g_ForcedNextMap),source,255,255,0, true) return end local query = #{mapname}>0 and table.concat({mapname},' ') or nil if not query then if g_ForcedNextMap then outputChatBox('#00FF90[shop]#f1f1f1Next map is '..getMapName(g_ForcedNextMap),source,255,255,0, true) else outputChatBox('#00FF90[shop]#f1f1f1Next map is not set',source,255,255,0, true) end return end local map, errormsg = findMap(query) if not map then outputChatBox(errormsg, source) return end if lastmap_B == map then outputChatBox('#00FF90[shop]#ffffffThat map has been palyed too much recently !',source,255,255,0, true) else g_ForcedNextMap = map local nameAh = getPlayerName(source) local nameAhB = string.gsub(nameAh, "#%x%x%x%x%x%x", "") outputChatBox('#00FF90[shop]#c8c8c8'..nameAhB..' bought map '..getMapName(g_ForcedNextMap)..' for $3500.',getRootElement(),255,255,0, true) givePlayerMoney(source, -1750) setElementData(source, 'Money', getPlayerMoney(source)) lastmap_B = g_ForcedNextMap end end addEventHandler('buyMapFromPanel', getRootElement(), buyMFP) --Find a map which matches, or nil and a text message if there is not one match function findMap( query ) local maps = findMaps( query ) -- Make status string local status = "Found " .. #maps .. " match" .. ( #maps==1 and "" or "es" ) for i=1,math.min(5,#maps) do status = status .. ( i==1 and ": " or ", " ) .. "'" .. getMapName( maps[i] ) .. "'" end if #maps > 5 then status = status .. " (" .. #maps - 5 .. " more)" end if #maps == 0 then return nil, status .. " for '" .. query .. "'" end if #maps == 1 then return maps[1], status end if #maps > 1 then return nil, status end end -- Find all maps which match the query string function findMaps( query ) local results = {} --escape all meta chars query = string.gsub(query, "([%*%+%?%.%(%)%[%]%{%}%\%/%|%^%$%-])","%%%1") -- Loop through and find matching maps for i,resource in ipairs(exports.mapmanager:getMapsCompatibleWithGamemode(getThisResource())) do local resName = getResourceName( resource ) local infoName = getMapName( resource ) -- Look for exact match first if query == resName or query == infoName then return {resource} end -- Find match for query within infoName if string.find( infoName:lower(), query:lower() ) then table.insert( results, resource ) end end return results end function getMapName( map ) return getResourceInfo( map, "name" ) or getResourceName( map ) or "unknown" end
  14. Pero, yo no quiero que se reemplace el admin, ademas en el scoreboard no hay cambios, todo es lo mismo, lo que cambia es en el admin que de allí manda al scoreboard para que aparescan las banderas y los paises, alguna otra sugerencia? EN RESUMEN: Eso ya lo probé y malogra el joinquit de países porque sale [NIL] o [False]
  15. --------- Linea 705: scoreboard_client elseif column.name == "Country" then dxDrawImage( topX+theX, y+s(1), 16, 11, content, 0, 0, 0, cWhite, drawOverGUI ) Entonces esto no puede funcionar?
  16. Función para editar el scoreboard para que aparezca las banderas?
  17. CIERRE POST - SOLUCIONADO
  18. Intenta con esto local names ={"MarineForce"} local tags ={"MarineForce"} local colors ={"#ff0000"} local acls={"Everyone"} --- Sin Grupo en el ACL, Para todos los jugadores con el TAG, si en caso creaste un grupo en el ACL asegurate que sea el correcto
  19. MrXz

    [HELP] Rank System

    well, I have ready about the scoreboard but what I look for is how to do ranking system, .... bone as this example Player 1 - Rank 1 Player 2 - Rank 3 Player 5 - Rank 7 if I explain? I just want a help, not an entire script
  20. Hi all , good going through my trunk of old scripts and I found this ---------- server.lua addEventHandler ("onPlayerRaceWasted",getRootElement(), function() killPed (source) setElementHealth (source,0) if (isPedInVehicle(source)) then blowVehicle (getPedOccupiedVehicle(source)) end end) addEventHandler ("onPlayerJoin",getRootElement(), function() setElementHealth (source,0) setTimer (setElementHealth,1500,1,0) savePlayerData (source,"lastPlayerName",getPlayerName(source)) end) addEventHandler ("onPlayerChangeNick",getRootElement(), function(olnick,newnick) savePlayerData (source,"lastPlayerName",newnick) end) function checkWinAndIfWinGiveWinCash (totalAmmo,killer,killerWeapon,bodypart,stealth) local rank = getAliveCount() if (rank == 1) then local allAlivePlayers = getAlivePlayers() local player = allAlivePlayers[1] local playerCount = getPlayerCount() local pointsToWin = playerCount *13 local cashToWin = playerCount *53 savePlayerData (player,"points",loadPlayerData(player,"points") + pointsToWin) savePlayerData (player,"cash",loadPlayerData(player,"cash") +cashToWin) outputChatBox (getPlayerName(player) .." #FF0000 Win! " .. tostring(pointsToWin) .." points and " .. tostring(cashToWin) .."$!",getRootElement(),255,0,0,true) end end addEventHandler ("onPlayerWasted",getRootElement(),checkWinAndIfWinGiveWinCash) addEventHandler ("onPlayerQuit",getRootElement(),checkWinAndIfWinGiveWinCash) function findPlayerByName (playerPart) for i,v in ipairs (getElementsByType ("player")) do if (string.find(getPlayerName(v),playerPart)) then return v end end end function getDeadCount () deadAmount = 0 for i,v in ipairs (getDeadPlayers()) do deadAmount = deadAmount +1 end return deadAmount end function getSpawnedCount () spawnedAmount = 0 for i,v in ipairs (getAlivePlayers()) do if (isPedInVehicle (v)) then spawnedAmount = spawnedAmount +1 end end return spawnedAmount end function getAliveCount () aliveAmount = 0 for i,v in ipairs (getAlivePlayers()) do aliveAmount = aliveAmount +1 end return aliveAmount end -- The load-and-save part. function loadPlayerData (player,datatype) local playerIP = getPlayerSerial (player) if (playerIP) then local root = xmlLoadFile ("users.xml") if (root) then local usersNode = xmlFindChild (root,"user",0) if (usersNode) then local playerRootNode = xmlFindChild (usersNode,"SERIAL_" .. getPlayerSerial(player),0) if not (playerRootNode == false) then local playerData = xmlNodeGetAttribute (playerRootNode,datatype) if (playerData) then xmlUnloadFile (root) return playerData else xmlNodeSetAttribute (playerRootNode,datatype,0) xmlSaveFile (root) xmlUnloadFile (root) return 0 end else local playerRootNode = xmlCreateChild (usersNode,"SERIAL_" .. getPlayerSerial(player)) xmlNodeSetAttribute (playerRootNode,datatype,0) xmlSaveFile (root) xmlUnloadFile (root) return 0 end end end end end function savePlayerData (player,datatype,newvalue) local playerIP = getPlayerSerial (player) if (playerIP) then local root = xmlLoadFile ("users.xml") if (root) then local usersNode = xmlFindChild (root,"user",0) if (usersNode) then local playerRootNode = xmlFindChild (usersNode,"SERIAL_" .. getPlayerSerial(player),0) if not (playerRootNode == false) then local newNodeValue = xmlNodeSetAttribute (playerRootNode,datatype,newvalue) xmlSaveFile (root) xmlUnloadFile (root) return newNodeValue else local playerRootNode = xmlCreateChild (usersNode,"SERIAL_" .. getPlayerSerial(player)) local newNodeValue = xmlNodeSetAttribute (playerRootNode,datatype,newvalue) xmlSaveFile (root) xmlUnloadFile (root) return newNodeValue end end end end end and well thought of making a system of rank with exp, and may do so using this script and adding to the scoreboard. or else how to do aid, thanks Sorry for bad english?
×
×
  • Create New...