Jump to content

Addlibs

Members
  • Posts

    1,060
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by Addlibs

  1. Port forwarding (in regards to /openports) is for incoming connections, not outgoing. The API server already has the necessary ports open, and therefore connection should work (unless there's firewall the outgoing server)
  2. If you don't understand basic English, then you best seek support in your native language forum section.
  3. Which line of the extract corresponds to line 89 of the full code?
  4. In the client console (F8), use /debugscript 3
  5. function setteamcolor(player, cmd, hex) if ( team1 ) then if hex:sub(1,1) == "#" then outputChatBox("Incorrect syntax: Invalid HEX colour", player) end if #(hex:sub(2)) == 3 or #(hex:sub(2)) == 6 then -- ensure the hex is either 3 characters long (eg. FFF) or 6 (eg. FFFFFF) local r, g, b = getColorFromString(hex) --inject the hex to the function, with # appended in front. Returns RGB. setTeamColor(team1, r, g, b) end end addCommandHandler ( "setteamcolor", setteamcolor ) /setteamcolor #123456 will set the team colour to RGB(18,52,86)
  6. If you created it you should be able to sort this out yourself. The code shows you're competent enough, and you even failed to provide the relevant /debugscript lines (if there aren't any, you could say that there are none) To summarise, please provide the relevant /debugscript lines if you expect people to help.
  7. I doubt that you own any rights to this script.
  8. local x = getPlayerName(killer) -- since this is the same for everyone, there's no point of defining it multiple times in the loop for plr in ipairs(getElementsByType("player")) do local y = ( victim == plr and "you" or getPlayerName(victim) ) -- if victim == the player its outputting message to, display "you", otherwise the victim's name (conditional operator, inline-IF-statement, or however you want to call this) ouputChatBox(x .. " killed " .. y, plr) end
  9. num1 = guiGetText ( editbox1 ) num2 = guiGetText ( editbox1 ) Both num1 and num2 come from the same edit box, which means you're just doing editbox1 value - editbox1 value (i.e. a-a) Change line 9 to num2 = guiGetText ( editbox2 ) --editbox2 not editbox1
  10. Actually, my code should work with the unmodified version of scoreboard (or more technically, dxscoreboard) - it is based on an extract from the voice resource which displays an icon on the scoreboard depending on the voice-state of a player (speaking, not speaking, muted) on the default scoreboard resource
  11. can't you just use the ORDER BY function in the SQL query? SELECT column1,column2,column3 FROM table ORDER BY column1 DESC -- (ASC is default)
  12. Set element data of the player, lets say, 'level_icon', to { ["type"] = "image", ["src"] = ":resource/file.ext", ["color"] = tocolor(255,255,255,255), ["width"] = 20, ["height"] = 20, } , then add a column to show level_icon element data under an unnamed column: exports.scoreboard:addScoreboardColumn("level_icon",getRootElement(),1,40," ") --Last argument, friendly name, is just a space in a string.
  13. That's because you attempt to collect p from the function in the timer but never passed a value for it in setTimer (therefore, within the timer function, p is nil). Line 58: end,5000,0,t_Element Also, inside the timer function (lines 46-57 inclusive), you should change every peds[t_Element] and t_Element into p because neither (unless declared globally) exist in the timer-attached function.
  14. Trigger a client event from server for everybody, which is attached to playSound. Client: addEvent("broadcast playSound", true) addEventHandler("broadcast playSound", root, playSound) Server: triggerClientEvent(root, "broadcast playSound", resourceRoot, "sound URL", loop)
  15. Addlibs

    Need CODE

    You can stop writing in capital letters, for a start. The code which Dimos7 sent is client-side but you need to define the position, key & state (see below) beforehand, otherwise it won't work. local x, y, z = --the co-ordinates where you want people to respawn at local key = --the key to press to respawn local state = --whether the above key should be pressed or released, "down" or "up" accordingly. --place before Dimos7's code
  16. Sorry but I don't think anyone, including myself, can understand your problem. Please clarify further?
  17. Line 6-7: You're looping a table that's a result from SQL, therefore no value within it is an element, therefore you should not use getElementData on line 7, but rather check the sub-value of v, for example, v.gang_name --or, v['gang_name'] --(same thing) Additionally, your second problem is that you're verifying who's from which gang without even querying the information (i.e. your SQL query does not tell you which gang who is from because you only requested to SELECT member_account and nothing else) — which is also quite useless since you've specifically told the SQL query to only retrieve members from a specific gang, so no other records will be returned - therefore, you do not need to check the gang of the record.
  18. getElementParent --as long as you don't change it manually beforehand, it should be linked to the Dynamic map, which's parent is the resource it originates from, i.e.: local obj = createObject(1337, 0, 0, 0) local map = getElementParent(obj) --usually the ID of this element is the name of the map XML file, or 'dynamic' as in, created by script, not map file local resourceElement = getElementParent(map) --nota bene: Resource element is not the same as Resource userdata local resourceName = getElementID(resourceElement) --works the same as getResourceName(resourceUserdata) but right now we only have the resourceElement, not the resourceUserdata local resourceUserdata = getResourceFromName(resourceName) Then you can check if the resource matches your criteria, i.e. if the name of it is equal to something, or if it's userdata is equal to, lets say, thisResource
  19. Set animation to an empty set and empty animation, i.e setPedAnimation(localPlayer, "", "") --Of course, replace localPlayer with the ped element who's animation you want to stop
  20. If you look at 'MTA' (port 22133) you can see a slight bit of oncoming text - I guess it's just hidden via photo editing for privacy (though it's only a local IP), besides, you can clearly see that the ports are open and functioning correctly.
  21. Self explanatory - your database table does not have a column named 'value'. Add that column into the table or correct it in the code, depending on whether it was meant to be 'value' or something else.
  22. Wrong section > Try viewforum.php?f=177
  23. Wrong section - try viewforum.php?f=177
  24. In URLs, %20 is a space, so the server should have returned the files correctly, but I'm glad you found a solution to your problem.
×
×
  • Create New...