Jump to content

[XGN]Razor

Members
  • Posts

    10
  • Joined

  • Last visited

Details

  • Gang
    [XGN]

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

[XGN]Razor's Achievements

Member

Member (5/54)

0

Reputation

  1. Im doing right now a bar and i have this problem: when the health is 100% works perfectly, but when the health is < 100, like 50 or 25, goes to the left side, this is the code: addEventHandler ("onClientResourceStart",getResourceRootElement(getThisResource()), function() sx,sy = guiGetScreenSize () healthx = sx/800*5 healthy = sy/600*500 healthxoverlay = sx/800*6.55 healthyoverlay = sy/600*502 showPlayerHudComponent ("health",false) counter = 0 normalhealthbar = false end) function render() if (counter == 50) then counter = 0 end local healthRelative = getElementHealth(getLocalPlayer())/100 dxDrawImage (healthx, healthy, 150, 20, "hpempty.png",90) dxDrawImageSection (healthxoverlay, healthyoverlay, 145*healthRelative, 13,0,0,healthxoverlay,healthyoverlay,"hpfull.png",90) if (isPedInVehicle (getLocalPlayer())) then local healthRelative = getElementHealth(getPedOccupiedVehicle(getLocalPlayer()))/1000 dxDrawImage (vehiclehealthx, vehiclehealthy, 76, 12, "hpempty.png") end end addEventHandler ("onClientRender",getRootElement(),render) where is the problem?
  2. Anyone knows how i can to do a progress bar with an dxDrawImage and dxDrawImageSection?
  3. forzenMT is for changing the data addEventHandler ( "onClientElementDataChange", getLocalPlayer(), function ( dataName ) if dataName == "exp" then frozenMT = 0 end end ) and cacheEXP is the exp that the player wins on an elementData, even if i delete the +frozenMT+cacheEXP the bar dont moves, only grows to both directions
  4. Hello, im doing a percent bar with an images, and i have an error doing the calculations, the bar looks fine at the first percents, but when reachs 100% and reset, goes to the 50% and never goes to the 0% and when the exp grow up, the bar moves to the right. sw,sh = guiGetScreenSize () function getPercent(level,expe) local level = math.min(tonumber(level or 0),(#Levels-1)) local needEXP = Levels[level+1] return ((tonumber(expe) or 0)/needEXP) end function getCentPer(level,expe) return math.ceil(getPercent(level,expe)*100) end function renderUHG() local lvl = (tonumber(getElementData(getLocalPlayer(),"level")) or 0) local pexp = (tonumber(getElementData(getLocalPlayer(),"exp")) or 0)+frozenMT+cachexp local myper = getCentPer(lvl,pexp) dxDrawImage(sw*0.0001,sh*.93,500,100,"emptybar.png") dxDrawImageSection(sw*0.035,sh*.94359,myper,70,100,50,100,100,"fullbar.png") im dont know how to put fine the u,v,usize,vsize variables
  5. Thanks Karim, you are great
  6. Thanks very much!, one more question , how can i send info to the database (for example the lvl and the exp) and get it? i need to use tables?
  7. Exactly, i dont know how to do it, and i cant find any tutorial or something like that. u.u
  8. Hello, i want to do an experience system, im watching one based on elementData(this:) addEvent ( "onZombieWasted", true ) addEventHandler ( "onZombieWasted", root, function ( theKiller ) triggerClientEvent(theKiller, "gret", getRootElement()) end ) function saveAccountData(player, progCount) local data = getElementData(player,"lvl") setAccountData(getPlayerAccount(player),"lvl",data) end addEvent("updateLevel",true) addEventHandler("updateLevel",getRootElement(),saveAccountData) function onPlayerQuitSaveData () saveAccountData(source,"lvl") end addEventHandler( "onPlayerQuit", root, onPlayerQuitSaveData) function onPlayerLoginLoadData(_, account) local lvl = getAccountData(account, "lvl") setElementData(source,"lvl",lvl) triggerClientEvent("setLevelTriggered", source, lvl) end addEventHandler("onPlayerLogin", root,onPlayerLoginLoadData) Im really newbie in the sql world, exist any guide or something to learn how to create it and how to use it? Thanks very much for reading, sorry for bad english.
×
×
  • Create New...