Jump to content

.:HyPeX:.

Members
  • Posts

    1,255
  • Joined

  • Last visited

Everything posted by .:HyPeX:.

  1. Dont expect us to fix it if it is not the full code dude. (or atleast containing needed stuff.)
  2. Lol guys.. How you wanna set an element health to a "NAME"? Its even obious to read, "NAMES" are not elements, they're usually strings!.. in any case: setElementHealth(player, value)
  3. Well, that gives error upon unpack, no table. This way it outputed Kills, as expected. function CheckLabels() LabelTable = {unpack(get("Labels"))} outputServerLog(LabelTable[1]) Dashboard.rankings.labels = {} for i=1, #LabelTable do Dashboard.rankings.labels[i] = LabelTable[i] end for c,v in ipairs(getElementsByType("player")) do triggerClientEvent(c,"UpdateLocalLabels",resourceRoot, Dashboard.rankings.labels) end end function onResourseStart() set("Labels", Dashboard.rankings.labels) setTimer(CheckLabels, 1000,0) end onResourseStart() Now, my problem is how to edit it, but i'll figure it out..
  4. "onClientVehicleDamage" has those parameters, and i'm not sure that if supports 3 and , It does support multiple ORs, but idk if ands, also in my experience, redefine localPlayer = getLocalPlayer() just in case. Post the script.
  5. That isnt a string itself? Becouse if yes, i cannot unpack it normally.. function CheckLabels() LabelTable = {unpack(get("Labels"))} Dashboard.rankings.labels = {} for i=1, #LabelTable do Dashboard.rankings.labels[i] = LabelTable[i] end for c,v in ipairs(getElementsByType("player")) do triggerClientEvent(c,"UpdateLocalLabels",resourceRoot, Dashboard.rankings.labels) end end
  6. addEventHandler("onClientRender",root,function() for i=0,360,0.25 do dxDrawLine(300,300,300+100*math.sin(math.rad(i)),300+100*math.cos(math.rad(i)),(i>=0 and i<=50) and tocolor(60,60,60) or (i>50 and i<=180) and tocolor(255,50,50) or (i>180 and i<=360) and tocolor(0,255,70)) end end) You can use this simple function for an output like this: That function doesnt looks totally right (The dark one does not totally reach the exact center of the circle..
  7. So i should make a custom way of editing them, but tables are like that itself? (If i wanna use them)
  8. Any errors in debug?
  9. Why you send it server-side? its unnecesary to do that, those events and fnc are also aviable client-side.
  10. I'd just make the fecthRemote client side. i use it in my BF3 gamemode to download the sounds, and the server works pretty good. (As far as ik, fetchRemote uses client's connection to download whatever you specified, any link should do, even outside the mta server, since in my case its to an external webpage (Thought it is hosted on the same VPS as the server)). eg: joining song at my sv: http://bf3-mta.tk/songs/bf3.mp3
  11. Why did you bought a server before even knowing what you had to do?
  12. This is a bit inneficient due to the loop, but try it. local guntable = { 23, 30, 32, 20, 9 } function weaponDisable(preSlot, NewSlot) local weapon = getPedWeapon(getLocalPlayer()) clear = nil for i,v in pairs(guntable) do if v == weapon then clear = true end end if clear then pre = nil for i,v in pairs(guntable) do if preSlot == v then pre = true end end if pre then setPedWeaponSlot(getLocalPlayer(),preSlot) else setPedWeaponSlot(getLocalPlayer(), guntable[math.random(#guntable)]) end end end addEventHandler ("onClientPlayerWeaponSwitch",getRootElement(), weaponDisable)
  13. Hey guys, reading over saw that you can set a table value to the settings, will admin panel be able to read and edit is as a table? also, should this work like this? Dashboard = { rankings = { labels = { "Kills", "Deaths", "Headshots", "PlayTime", "EXP", "Level", "Rank", }, } function onResourseStart() set("Labels", Dashboard.rankings.labels) setTimer(CheckLabels, 1000,0) end onResourseStart() function CheckLabels() LabelTable = {unpack(get("Labels"))} Dashboard.rankings.labels = {} for i=1, #LabelTable do Dashboard.rankings.labels[i] = LabelTable[i] end for c,v in ipairs(getElementsByType("player")) do triggerClientEvent(c,"UpdateLocalLabels",resourceRoot, Dashboard.rankings.labels) end end Meta: <settings> <setting name="*Labels" value="{Kills, Deaths, Headshots, PlayTime, EXP, Level, Rank}" friendlyname="Dashboard Labels" group="" accept="" examples="cash, kills" desc="" /> </settings>
  14. Well i dont know why i'm getting this error: error in line 3: attempt to index field '?' (a number value) (Note: its line 3 in this little code part) for i=1, 5 do for c=1, #Dashboard.rankings.data[Dashboard.rankings.current][i] do dxDrawText(Dashboard.rankings.data[Dashboard.rankings.current][i][1], x*0.58,y*0.20 + ((y*0.04) * i) , x, y, tocolor(255,255,255,255), 2/ ( ( 1360 / x ) * ( 768 / y ) ), "default-bold", "left", "top", false, false, true,true) dxDrawText(Dashboard.rankings.data[Dashboard.rankings.current][i][2], 0,y*0.20 + ((y*0.04) * i) , x*0.93, y, tocolor(255,255,255,255), 2/ ( ( 1360 / x ) * ( 768 / y ) ), "default-bold", "right", "top", false, false, true,true) end end
  15. try making an rpg, its good way to learn.
  16. It is not necessarily a server function, just use "onClientPlayerSpawn" instead.
  17. Fixed it already, there was a bug becouse "table" wasnt correctly specified.
  18. not work Can you post the code? Maybe: Selected = guiGridListGetSelectedItem(grid) if ( type ( Selected ) ~= number) then end
  19. setTeamColor() getTeamColor() setVehicleColor()
  20. You must make a pattern to look after in order to use %x: "#%x%x%x%x%x%x" will catch the 6 inmediate characters after #.
  21. You can basically take adventage of "getCursorPosition" to do it.
  22. idk why it is expecting a string at argument 1.. so it fails. function UpdateClient(client, table) triggerClientEvent(client, "UpdateClientRank", resourceRoot, table) end
  23. Not sure, i'll probably switch to a table..
  24. Expected number at argument 2, got none...
×
×
  • Create New...