Jump to content

Fabioxps

Members
  • Posts

    229
  • Joined

  • Last visited

Everything posted by Fabioxps

  1. I want to cancel what is being sent. local mycode = [ ..., code ] triggerLatentClientEvent (player,"enviarClient",10000,player,mycode) addCommandHandler("cancel",function() local table = getLatentEventHandles ( player ) local handler = table[#table] if handler then cancelLatentEvent( handler ) outputChatBox(tostring(getLatentEventStatus( handler)["percentComplete"])) end end)
  2. Thanks Bro. the login script uses need to give admin rights this is not reliable anyway.
  3. I'm warning not to give admin rights to the compiled resources.
  4. nobody will use compiled script, free uncompiled it can be dirty. (Backdoor)
  5. text not rotate @gallardo
  6. can give an example of how to use dxSetShaderTransform
  7. Fabioxps

    not appear

    not appear img local w, h = guiGetScreenSize () local x, y, z = getWorldFromScreenPosition ( w/2, h/2, 10 ) addEventHandler("onClientResourceStart", resourceRoot, function() local material = dxCreateTexture("img/user.png") myRenderTarget = dxCreateRenderTarget(1024, 1024, true) dxSetRenderTarget( myRenderTarget ) local width, height = dxGetMaterialSize(material) dxDrawImage(400, 400, width-400*2, height-400*2, material, 0, 0, 0, color) dxSetRenderTarget() end ) outputDebugString("a") addEventHandler( "onClientRender", root, function() if myRenderTarget then dxDrawMaterialLine3D( x,y,z, x, y, z+1, myRenderTarget, 100, tocolor( 62,175,246,160 ), x, y, z+500000000) end end)
  8. country because it returns an error value nil? function CToptimes:doOnServerSentToptimes( data, serverRevision, playerPosition ) outputDebug( 'TOPTIMES', 'CToptimes:doOnServerSentToptimes ' .. tostring(#data) ) -- Calc number lines to use and height of window local numLines = math.clamp( 0, #data, 50 ) self.size.y = 15 + 46 + 15 * numLines -- Set height of window local sizeX = self.size.x local sizeY = self.size.y guiSetSize( self.gui['windowbg'], sizeX, sizeY, false ) -- Make listTimes contains the correct number of labels self:updateLabelCount(numLines) -- Update the list items for i=1,numLines do local timeText = data[i].timeText if timeText:sub(1,1) == '0' then timeText = ' ' .. timeText:sub(2) end if data[i].dateRecorded == "nil" then data[i].dateRecorded = "30.03.2012" end if fileExists(":admin/client/images/flags/"..country[i]..".png") then country[i] = ":admin/client/images/flags/"..country[i]..".png" end local line = string.format( '%d. %s %s %s', i,timeText,data[i].dateRecorded,country[i],data[i].playerName ) guiSetText ( self.gui['listTimes'][i], line ) if i == playerPosition then guiLabelSetColor ( self.gui['listTimes'][i], 0, 255, 255 ) else guiLabelSetColor ( self.gui['listTimes'][i], 255, 153, 0 ) end end -- Debug if _DEBUG_CHECK then outputDebug( 'TOPTIMES', 'toptimes', string.format('crev:%s srev:%s', tostring(self.clientRevision), tostring(serverRevision) ) ) if self.clientRevision == serverRevision then outputDebug( 'TOPTIMES', 'Already have this revision' ) end end -- Update status self.clientRevision = serverRevision self.listStatus = 'Full' self:updateShow() end
  9. I have done this but does not work
  10. I don't know how to use ' interpolateBetween ' I want the images that I am creating with this effect I want the images in and out of the corner of the screen local sX,sY = guiGetScreenSize() local SCALE = (sX/1920)*(sY/1200) local KEY = {"F1"} local _function = { ANIMATION = false, ANIMATIONS = false, TOP = { SIZE = {sX,sY/13}, POS = {0,0-sY/13-sY/13/40}, FONT = 6*SCALE, }, BOTTON = { SIZE = {sX,sY/10}, POS = {0,sY+sY/10+40}, IMAGEMS = { URL = {"img/map.png","img/tune.png","img/music.png","img/stats.png","img/plus.png","img/options.png"}, POS = {{sX/2-(((sY/10)+(sY/40))*3),50},{sX/2-(((sY/10)+(sY/40))*3),120},{sX/2-(((sY/10)+(sY/40))*3),190},{sX/2-(((sY/10)+(sY/40))*3),260},{sX/2-(((sY/10)+(sY/40))*3),330},{sX/2-(((sY/10)+(sY/40))*3),400}}, SIZE = {sY/2,sY/15}, VISIBLE = {150,150,150,150,150,150,150} }, _dxDrawText = {"RACES","CUSTOMIZE CAR","MUSIC","STORE","RANKING","OPTIONS"} }, VISIBLE = 0, TICK = getTickCount(), LEFT = 0, BLOOCK = true, } _LISTSELECTDX = function() for _G = 1,#_function.BOTTON.IMAGEMS.URL do dxDrawImage(_function.BOTTON.IMAGEMS.POS[ _G ][1],_function.BOTTON.IMAGEMS.POS[ _G ][2],_function.BOTTON.IMAGEMS.SIZE[1],_function.BOTTON.IMAGEMS.SIZE[2],_function.BOTTON.IMAGEMS.URL[ _G ],0,0,0,tocolor(255,255,255,_function.BOTTON.IMAGEMS.VISIBLE[ _G ]),true) end end addEventHandler("onClientRender",getRootElement(),_LISTSELECTDX) function ANIMATIONS_function() if not _function.ANIMATION then _function.TICK = getTickCount() _function.ANIMATION = true _function.ANIMATIONS = true showCursor(true) addEventHandler("onClientPreRender",getRootElement(),ANIMATION_functionOn) else _function.TICK = getTickCount() _function.ANIMATION = false _function.ANIMATIONS = true showCursor(false) addEventHandler("onClientPreRender",getRootElement(),ANIMATION_functionOff) end end bindKey(KEY[1],"down",function() if not _function.ANIMATIONS then ANIMATIONS_function() end end) function ANIMATION_functionOn() local TICK = getTickCount() - _function.TICK local progress = TICK/500 if progress >= 1 then progress = 1 removeEventHandler("onClientPreRender",getRootElement(),ANIMATION_functionOn) _function.ANIMATIONS = false end _function.BOTTON.POS[2] = interpolateBetween(sY,0,0,sY-sY/10,0,0,progress,"Linear") for _G = 1,#_function.BOTTON.IMAGEMS.URL do _function.BOTTON.IMAGEMS.POS[ _G ][2] = _function.BOTTON.POS[2] end end function ANIMATION_functionOff() local TICK = getTickCount() - _function.TICK local progress = TICK/500 if progress >= 1 then progress = 1 removeEventHandler("onClientPreRender",getRootElement(),ANIMATION_functionOff) _function.ANIMATIONS = false end _function.BOTTON.POS[2] = interpolateBetween(sY-sY/10,0,0,sY+_function.TOP.SIZE[2]/40,0,0,progress,"Linear") for _G = 1,#_function.BOTTON.IMAGEMS.URL do _function.BOTTON.IMAGEMS.POS[ _G ][2] = _function.BOTTON.POS[2] end end
  11. it is possible to leave a gui totally square
  12. and exactly what I want to thank you do not know how much I am thankful
  13. I want to load a text letter by letter not have errors
  14. the map only loads once and is invisible for i, v in pairs(events) do _removeEventHandler(v.event, v.parent, v.func) end events = {} function desLoadingDM() for i, v in pairs(objects) do if isElement(v) then destroyElement(v) end end objects = {} for i, v in pairs(markers) do if isElement(v) then destroyElement(v) end end markers = {} for i, v in pairs(timers) do if isTimer(v) then killTimer(v) end end timers = {} for i, v in pairs(events) do _removeEventHandler(v.event, v.parent, v.func) end events = {} for i, v in pairs(colspheres) do if isElement(v) then destroyElement(v) end end colspheres = {} for i, v in pairs(sounds) do if isElement(v) then _stopSound(v) end end sounds = {} for i, v in pairs(commands) do _removeCommandHandler(v) end commands = {} for i, v in pairs(models) do engineRestoreModel(v) end models = {} for i, v in pairs(binds) do _unbindKey(v.key) end binds = {} dlFiles = 0 dlScripts = 0 loaded = false setTimer(function() triggerServerEvent("loadNewMapDM",root, loadNewMapDM) end,3000,1) end addEvent("desLoadingDM",true) _addEventHandler("desLoadingDM",root,desLoadingDM) --DM FABINHO SCRIPT TEST BUGS function loadNewMapDM() local newMap = coreServer:getRandomMap("DM") if newMap then if not getResourceFromName("deathmatch") then createResource("deathmatch") end if fileExists(":deathmatch/meta.xml") then fileDelete(":deathmatch/meta.xml") end local metaXML = xmlCreateFile(":deathmatch/meta.xml","meta") local metaXMLNode = xmlCreateChild(metaXML, "info") xmlNodeSetAttribute(metaXMLNode,"author","Fabinho") xmlNodeSetAttribute(metaXMLNode,"description","DM-Lobby Maploader") xmlNodeSetAttribute(metaXMLNode,"type","script") metaXMLNode = xmlCreateChild(metaXML, "min_mta_version") xmlNodeSetAttribute(metaXMLNode,"server","1.3.1") local scriptNode = xmlCreateChild(metaXML, "script") xmlNodeSetAttribute(scriptNode,"src","loader.lua") xmlNodeSetAttribute(scriptNode,"type","client") fileCopy("loader/dmloader.lua", ":deathmatch/loader.lua", true) local scriptNode = xmlCreateChild(metaXML, "script") xmlNodeSetAttribute(scriptNode,"src","loader_s.lua") xmlNodeSetAttribute(scriptNode,"type","server") if fileCopy("loader/dmloader_s.lua", ":deathmatch/loader_s.lua",true) then end xmlSaveFile(metaXML) xmlUnloadFile(metaXML) if fileExists(":deathmatch/map.xml") then fileDelete(":deathmatch/map.xml") end local mapXML = xmlCreateFile(":deathmatch/map.xml","meta") local metaXML = xmlLoadFile(":"..newMap.mapname.."/meta.xml") if metaXML then for i, m in ipairs(xmlNodeGetChildren(metaXML)) do local metaXMLName = xmlNodeGetName(m) ---Checks if the XMl-File is a .map file--- if metaXMLName == "map" then local mapPath = xmlNodeGetAttribute(m,"src") if mapPath and fileExists(":"..newMap.mapname.."/"..mapPath) then local mapFile = xmlLoadFile(":"..newMap.mapname.."/"..mapPath) if mapFile then for r, p in ipairs(xmlNodeGetChildren(mapFile)) do local objectType = xmlNodeGetName(p) if objectType == "spawnpoint" then table.insert(dmTable.Spawnpoints,{ modelID = tonumber(xmlNodeGetAttribute(p, "vehicle")), interiorID = tonumber(xmlNodeGetAttribute(p, "interior")), posX = tonumber(xmlNodeGetAttribute(p, "posX")), posY = tonumber(xmlNodeGetAttribute(p, "posY")), posZ = tonumber(xmlNodeGetAttribute(p, "posZ")), rotX = tonumber(xmlNodeGetAttribute(p, "rotX")), rotY = tonumber(xmlNodeGetAttribute(p, "rotY")), rotZ = tonumber(xmlNodeGetAttribute(p, "rotZ")), dimension = 1 }) elseif objectType == "object" then table.insert(dmTable.objects,{ modelId = tonumber(xmlNodeGetAttribute(p,"model")), interiorID = tonumber(xmlNodeGetAttribute(p, "interior")) or 0, posX = tonumber(xmlNodeGetAttribute(p,"posX")), posY = tonumber(xmlNodeGetAttribute(p,"posY")), posZ = tonumber(xmlNodeGetAttribute(p,"posZ")), rotX = tonumber(xmlNodeGetAttribute(p,"rotX")), rotY = tonumber(xmlNodeGetAttribute(p,"rotY")), rotZ = tonumber(xmlNodeGetAttribute(p,"rotZ")), doublesided = xmlNodeGetAttribute(p,"doublesided"), dimension = 1 }) elseif objectType == "marker" then table.insert(dmTable.marker,{ theType = xmlNodeGetAttribute(p, "type"), interiorID = tonumber(xmlNodeGetAttribute(p, "interior")), posX = tonumber(xmlNodeGetAttribute(p, "posX")), posY = tonumber(xmlNodeGetAttribute(p, "posY")), posZ = tonumber(xmlNodeGetAttribute(p, "posZ")), size = tonumber(xmlNodeGetAttribute(p, "size")), color = xmlNodeGetAttribute(p, "color"), dimension = 1 }) elseif objectType == "racepickup" then table.insert(dmTable.pickup,{ pickupType = xmlNodeGetAttribute(p, "type"), posX = tonumber(xmlNodeGetAttribute(p, "posX")), posY = tonumber(xmlNodeGetAttribute(p, "posY")), posZ = tonumber(xmlNodeGetAttribute(p, "posZ")), interiorID = tonumber(xmlNodeGetAttribute(p, "interior")), vehicle = tonumber(xmlNodeGetAttribute(p, "vehicle")) or false, dimension = 1 }) end end end xmlSaveFile(mapFile) xmlUnloadFile(mapFile) end ---Checks if the XML File is a Script File--- elseif metaXMLName == "script" then local scriptPath = xmlNodeGetAttribute(m,"src") fileCopy(":"..newMap.mapname.."/"..scriptPath, ":deathmatch/"..scriptPath,true) local scriptNode = xmlCreateChild(mapXML,"file") xmlNodeSetAttribute(scriptNode,"src",scriptPath) xmlNodeSetAttribute(scriptNode,"downloaded","false") ---Checks if the XMl File is a File--- elseif metaXMLName == "file" then local filePath = xmlNodeGetAttribute(m,"src") fileCopy(":"..newMap.mapname.."/"..filePath, ":deathmatch/"..filePath,true) local fileNode = xmlCreateChild(mapXML,"file") xmlNodeSetAttribute(fileNode,"src",filePath) xmlNodeSetAttribute(fileNode,"downloaded","false") end end end local xmlSettings = xmlFindChild ( metaXML, "settings", 0) local xmlChild = xmlCreateChild(mapXML, "settings") i = 0 while true do local xmlNode = xmlFindChild ( xmlSettings, "setting", i) if not xmlNode then break else mapNode = xmlCreateChild(xmlChild, "setting") xmlNodeSetAttribute(mapNode, "name", xmlNodeGetAttribute(xmlNode, "name")) xmlNodeSetAttribute(mapNode, "value", xmlNodeGetAttribute(xmlNode, "value")) i = i + 1 end end xmlSaveFile(mapXML) xmlUnloadFile(mapXML) xmlUnloadFile(metaXML) local file = fileOpen(":deathmatch/map.xml") local map = "" if file then --outputChatBox("OK") while not fileIsEOF(file) do map = map..""..fileRead(file,500) end end fileClose(file) mapDM = map dnsp = dmTable.Spawonpoints startResource(getResourceFromName("deathmatch")) end for i, p in ipairs(getGamemodePlayers("deathmatch")) do setUPDMPlayer(p,dmTable.Spawnpoints,dmTable.objects,dmTable.marker,dmTable.pickup) end end addEvent("loadNewMapDM",true) addEventHandler("loadNewMapDM",root, loadNewMapDM) function setUPDMPlayer(player,spawn,o,m,p) --outputChatBox(#spawn) if spawn then toggleControl(player,"vehicle_secondary_fire",true) toggleControl(player,"vehicle_primary_fire",false) local rand = math.random(tonumber(#spawn)) spawnPlayer(player,spawn[rand].posX,spawn[rand].posY,spawn[rand].posZ) setElementDimension(player,1) local vehicle = createVehicle(spawn[rand].modelID,spawn[rand].posX,spawn[rand].posY,spawn[rand].posZ,spawn[rand].rotX,spawn[rand].rotY,spawn[rand].rotZ) setElementDimension(vehicle,1) fadeCamera(player,true) setCameraTarget(player,player) setCameraTarget(player,vehicle) setElementFrozen(vehicle,true) warpPedIntoVehicle(player,vehicle) setElementData(vehicle,"DMVehicle",true) setElementData(player,"curVehicle",veh) setElementAlpha(player,255) setElementFrozen(player,false) setElementData(player,"ghostmode",true) end triggerLatentClientEvent(player,"loadMapDM",500000,false,root,mapDM,o,m,p) end addEvent("dmDownloadFinished",true) addEventHandler("dmDownloadFinished",getRootElement(),function(player) table.insert(readyDMPlayers,{ player = player }) startCountdownDM(player) end) function setPlayerDMWaitRound(player) if isDmMapRunning() then end end function startCountdownDM(player) triggerClientEvent(player,"startCountdown",root) setTimer(startRoundDM,3800,1,player) end function startRoundDM(player) setElementFrozen(getPedOccupiedVehicle(player),false) setElementData(player,"state","ready") --setElementData(player,"state","alive") end addEvent("killDMPlayer",true) addEventHandler("killDMPlayer",root,function() if isPedInVehicle(source) and getElementHealth(source) > 0 then if getElementData(source,"state") ~= "ready" then setTimer(function() destroyElement(getPedOccupiedVehicle(source)) killPed(source) end,10000,1) else destroyElement(getPedOccupiedVehicle(source)) killPed(source) end end triggerClientEvent(source,"desLoadingDM",root,desLoadingDM) end)
×
×
  • Create New...