Jump to content

Hale

Members
  • Posts

    174
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by Hale

  1. You're missing a SQL table that is used in particular functions, nothing much anyone can help you here...
  2. You shouldn't really be asking for someone to make a script for you in this section, as it is strictly used for guiding and helping people that require assistance.
  3. Either remove that anti-cheat protection or find a way to update element data via server side (triggerServerEvent)
  4. Hale

    can't store data

    Try doing this and tell me if it works: function mg_pos() createMG(-2861.9, 19.4, 15.83, 0, 0, 188) end addEventHandler ( "onResourceStart", resourceRoot, mg_pos) local mgs = { } local weapon_bases = { } local weapons = { } function createMG(posX,posY,posZ,rotX,rotY,rotZ) local number = #mgs+1 mgs[number] = createObject ( 356, 0,0,0) -- this is where the data will be stored (new line) weapon_bases[number] = createObject ( 1897, posX,posY,posZ,rotX,rotY,rotZ) weapons[number] = createObject ( 356, 0,0,0) attachElements ( weapons[number], weapon_bases[number], -0.55, 0, 0.75, 0, 0, 0) setElementData ( mgs[number], "weapon_base", weapon_bases[number]) setElementData ( mgs[number], "weapon", weapons[number]) setElementAlpha(weapon_bases[number], 0) setTimer ( event, 500, 1, mgs[number] ) end function event(mg) local weapon = getElementData ( mg, "weapon" ) triggerClientEvent("createRealWeapon", root, weapon, weapon2) end
  5. Could you show us the entire function? Is the priceWidth variable declared at all?
  6. I agree with @pa3ck here, you should definitely create wiki pages for your library. Stunning looks, and I love the variety of options to manipulate with created drawings, amazing job.
  7. Could you please provide more information? When is this function being called, what is g_Prefs.securitylevel and what is the purpose of this function?
  8. Hale

    can't store data

    You should either use the table properly with table.insert or simply use MTA function createElement and then attach data to it. Your choice, both work just fine although I'd go with tables because few ticks matter to me (for performance).
  9. Can you please be more specific? What kind of zones, what is their use and how do you plan on making them?
  10. We don't know your scripts nor their location, so please be more specific and detailed when requesting help here. Give us the part of your script that isn't working correctly, explain what's the problem and we'll try to help you out, but we definitely can't help you if you cannot even find your own resource location.
  11. createVehicle There are parameters in this function that will set created vehicle's position.
  12. Find the line 1364 in fr_client.lua and check which gui element is the argument of function guiCheckBoxSetSelected, then check if that argument is the right one to be there or not. Can't tell you anything else since you didn't provide any code.
  13. Hale

    [TUT] Debugging

    Nice job, should be useful for all those in need of help. I'd also like to mention the outputDebugString 'level' variable consists of 4 different types:
  14. For every drawing (dxDrawRectangle, dxDrawLine et cetera) position use this: screenWidth/2.4566 I used 2.4566 (random number) as an example, which you'd get by dividing the actual screen width you used for making the GUI (800?) with the GUI position number that suited in the resolution. I know I explained it really :~ty, but hopefully this formula helps: x=playersScreenWidth/(screenWidthUsedForMakingGUI/actualNumberForGUI) Hard to explain
  15. Element data doesn't create lags for servers with a smaller playerbase, but it's different when it comes to servers with 100+ players... I doubt using one or two element data's for players will make some lag, so I'll probably use that. If anyone does have a suggestion please post one!
  16. I'm trying to avoid using that function as much as possible for the sake of performance, do you have any other ideas?
  17. Hale

    spawn system

    Hi, first off you're trying to get the 4th value of randomSpawnTable which doesn't exist (randomSpawnTable[random][4])? Second, to actually know if a player is joining for the first time or not, I'd suggest you store every player's serial key once they join in XML file or SQL table (your choice). That way you can loop through the XML file or SQL table in the onPlayerJoin function and if no serial matches his own then use setElementFrozen.
  18. Hi, I'm trying to find the best and fastest (when it comes to performance) way to export a function 'getAccountAdminLevel' to client-side, the problem is it contains some MTA functions that are made server-side only. I know a few ways already but find them quite unstable and too long for such a simple task. Does anyone have any ideas or suggestions? function getAccountAdminLevel(player) if not player or not isElement(player) or not getElementType(player) == "player" then return 0 end local account = getPlayerAccount(player) if not account or isGuestAccount(account) then return 0 end local acc = getAccountName(account) if not acc then return 0 end acc = "user."..acc local adminLevel = "Player" local groupList = aclGroupList() for i=1, #groupList do local groupName = aclGroupGetName(groupList[i]) if not unwantedGroups[groupName] and isObjectInACLGroup (acc, groupList[i]) then adminLevel = groupName end end for i=1, #adminLevels do if adminLevel == adminLevels[i] then return i end end return 0 end Thanks in advance!
  19. Never mind, I found the best (I think so at least) way to get the exact element type that has that exact ID. By combining these two functions: getElementsByType() getElementID()
  20. You can do that yourself though, can't you? I'd rather want MTA developers focusing on other more important stuff than that.
  21. I agree with Blaster here, we really need a better trailer sync.
  22. WARNING: mysql/serverside.lua:22: Bad argument @ 'dbQuery' [Expecteddb-connection at argument 1, got nil] It says that 'userdata_db' isn't a database connection, meaning you failed to connect to the database.
  23. Too much of a hassle I guess? Does anyone else have any other suggestion, pretty please?
  24. I've been using setElementID for many different element types, such as vehicles, objects, players, items, cameras and so on. Now when I use getElementByID on an element with low ID, how to get the exact element I want? I've tried using the second optional argument 'index' but that is sort of useless when I have 10+ different elements with the same ID. Any ideas for how to get the exact element I want, that will have the fastest performance?
×
×
  • Create New...