Jump to content

Noki

Members
  • Posts

    851
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Noki

  1. That makes much more sense. What if you were to encrypt the data with a private key? That would make it very hard to modify the data stored client-side.
  2. As we know, a table is made up of two things, a key and a value, where a key corresponds to a value. Let's use your table as an example. table = { ["Exhaust"] = { {"1018", "1019", "1020", "1021", "1022"}; {"exh_b_ts", "exh_b_t", "exh_b_l", "exh_b_m", "exh_b_s"}; {"Upswept", "Twin", "Large", "Medium", "Small"} }, ["Rims"] = { {"1025", "1073", "1074", "1075"} {"wheel_or1", "wheel_sr6", "wheel_sr3", "wheel_sr2"} {"Offroad", "Shadow", "Mega", "Rimshine"} } } If I want to print the first value of the third table in Exhaust, I would do: outputDebugString(table["Exhaust"][3][1]) That produces -> "Upswept" Don't see your problem as one big complex problem, break it down into smaller problems. Doing 'table["Exhaust"]' just gives me another table, which has 3 sub tables in that (each identified by a number (1, 2 or 3)). If I do 'table["Exhaust"][3]' I also get another table. But now I have values that correspond to strings. Of course, you can make your table a bit easier to navigate by using each item type as a key that corresponds to a value. table = { ["Exhaust"] = { ["1018"] = {"exh_b_ts", "Upswept"}, } }
  3. The Lua tags only work for functions, not events. You will need to use onClientMinimize to detect minimization. And you will need to use onClientRestore to detect when a client restores their screen. The following outputs in the chat box what time you minimized the screen. addEventHandler("onClientMinimize", root, function () local t = getRealTime() outputChatBox("You minimized your screen at "..t.hour..":"..t.minute) end )
  4. You don't have randomLabel declared anywhere in the script. And you're trying to get the length of it (using the # operator). Trying to get the length of a nil (which means nothing) value will not work. It's like trying to get the hair length of someone who is bald. It just doesn't work. I'm assuming you wanted to pick a random text entry from informationLabels instead. So, just use the fix DTC12 provided. Use the length of informationLabels (which is a table that exists within your script).
  5. Noki

    Problem

    exports['roleplay-accounts']:getAdminRank(player) exports['roleplay-accounts']:getRealPlayerName(player) exports['roleplay-accounts']:getAccountName(player) Any one of these functions returns a boolean (true or false). From what you've provided, I will assume everything else is fine but getAdminRank returns false. Which means the player in question does not have an admin level.
  6. No, that's a massive security risk. You can just use triggerServerEvent instead.
  7. Noki

    abc

    You also aren't helping by putting screenshots in with a link to the leaked scripts in question.
  8. This isn't 2008 anymore. AVG took quite a dip in quality since then. Also, this thread isn't about suggesting an anti-virus. As we can see, the OP is quite adamantly against it (and has justified why).
  9. SQL works off rows (also called records). For you to update a record/row, you first need to have one in there. When you want to add data, use INSERT INTO. If you want to update data for a row that already exists, use UPDATE. Also, userdata won't work with SQL. So when you try and pass source into the account field, it won't work. Get the account name instead using getAccountName(getPlayerAccount(source)).
  10. Noki

    [HELP] CST server

    C'mon dude. It's at the top of the website and even in your address bar.
  11. Noki

    MTA 5 ?

    The sad thing about this, is that the project FiveM cannot continue developing thanks to Take Two You're a bit late on that one.
  12. getKeyBoundToCommand("reconnect")
  13. Noki

    [HELP] CST server

    Or you could just leave them to die like they all usually do within a month. People get upset with another server and create their own with exactly the same scripts. Then the newer one shuts down and everyone goes back to the old one. Anyway, my point is that it's better to try to contact the host first before starting to ddos and do stuff like that as it affect so many others negative too. Trust me, most hosts do care about what's running on their servers, especially pirated or leaked stuff that could get them sued if they don't do anything, although when you report you gotta be more constructive than just: "Hey they stole my scripts!" and include some real proof that you own the resources. Just don't DDoS anyone altogether. These servers could be shared or hosted on shared machines. I don't think someone would like their online store being down because of someone's beef in a game.
  14. if not aclGetGroup("Admin") then outputChatBox("Awesome") That code will output 'Awesome' if the ACL group does not exist. You used 'if not aclGetGroup("Admin")'. outputDebugString("Does 'Admin' group exist? "..tostring(aclGetGroup("Admin"))) If it outputs false or nil, it doesn't exist. If it outputs something like 'userdata', it's an ACL group.
  15. Noki

    Rounded Borders

    The chatbubbles resource does exactly this. Here's an excerpt: dxDrawRectangle(posx - (3 + (0.5 * width)),posy - (2 + (v[4] * 20)),width + 5, 19,tocolor(0,0,0,105)) dxDrawRectangle(posx - (6 + (0.5 * width)),posy - (2 + (v[4] * 20)),width + 11, 19,tocolor(0,0,0,50)) dxDrawRectangle(posx - (8 + (0.5 * width)),posy - (1 + (v[4] * 20)),width + 15, 17,tocolor(0,0,0,20)) dxDrawRectangle(posx - (10 + (0.5 * width)),posy - (1 + (v[4] * 20)),width + 19, 17,tocolor(0,0,0,50)) dxDrawRectangle(posx - (10 + (0.5 * width)),posy - (v[4] * 20) + 1,width + 19, 13,tocolor(0,0,0,20)) dxDrawRectangle(posx - (12 + (0.5 * width)),posy - (v[4] * 20) + 1,width + 23, 13,tocolor(0,0,0,50)) dxDrawRectangle(posx - (12 + (0.5 * width)),posy - (v[4] * 20) + 4,width + 23, 7,tocolor(0,0,0,20))
  16. In Notepad++, you can do it like this. Go to the 'Encoding' tab, and select UTF-8.
  17. Why are you connecting via port 22003? The default MySQL port is 3306 - use that instead. Also, this code looks so damn familiar. In fact, it's line for line exactly the same as CSG's. That's reverse engineering to a whole new level!
  18. If the player is online, you can do something like this: getPlayerName(getAccountPlayer(getAccount("johan12"))) However, if they're not online, you will need to do something like what Tox said.
  19. t = {["yes"] = 1, ["no"] = 0} t.yes --> 1 t["yes"] --> 1 t.no --> 0 t["no"] --> 0 It's just a different way of writing it.
  20. Noki

    2 questions

    My bad. I thought you meant a player's draw distance. I don't think you're able to do that. Though I think if you have your draw distance set to maximum in your MTA settings, you might see the player from further off.
  21. It doesn't return all strings in the table. math.random takes two values, a minimum value and a maximum value. It returns one value, a random number. You're getting a value in a table from that number as an index.
  22. math.random(1, #jobtypes)
  23. Noki

    2 questions

    1. Bonus did a good job of explaining a possible way to do that. 2. setFarClipDistance setFogDistance
  24. The code you provided only shows the markers being created. When you created the ped and marker, include a something like this. -- Keep this up the top of your script markers = {} peds = {} -- Replace the line you have createMarker/createPed with this (but include your arguments) markers[index] = createMarker(...) peds[index] = createPed(...) Give the ped the same index as the marker. When they aim at the ped, set a global variable to the index of the ped within the table. for i, ped in ipairs(peds) do if (aimElement == ped) then ind = i break end end When the robbery finishes, you get the marker from the index previously got with the ped and destroy it. if (markers[ind] and isElement(markers[ind])) then destroyElement(markers[ind]) ind = nil end Probably not the most elegant solution, but it's what I would do.
  25. It's what element the event is attached to. So when something happens to that element, the event triggers a function. root would mean whenever something happens to any element (that fits within the scope of the event obviously). localPlayer would attach the event to the local player. So when anything happens to the local player, as long as it's in the scope of the event, it will trigger a function. When something happens to any element --> Do this (root) When something happens to the local player --> Do this (local player)
×
×
  • Create New...