Jump to content

1B0Y

Members
  • Posts

    130
  • Joined

  • Last visited

Everything posted by 1B0Y

  1. Null System Works offers this gamemode for free: https://github.com/NullSystemWorks/mtadayz Enjoy!
  2. I failed the test, but i'm part of the team... uh oh
  3. Had baseplate work with some of my projects in the past. A very well developer that I tend to call back on future projects. Recommended
  4. Is this with my compiler or IIYAMAs?
  5. 1B0Y

    Disconnected !

    Reinstall GTA SA
  6. 1B0Y

    Disconnected !

    Reinstall the game. problem solved.
  7. Well, Clippy is already present in our project: Sooo, anything's possible in this project haha
  8. It's actually Dutch It's based on one of the old old DM servers back in DP2 days which me and my other project manager DLmass adored. We're now re-introducing that into the MTA community as a public closed-source gamemode
  9. Oh wait, my bad... removeAccountData is a "useful function" lmao. I honestly haven't touched account functions in years as I create a custom account system with (My)SQL
  10. 1B0Y

    lua

    @Anubhav by the term "learning", I meant the terms of what the function does
  11. The resource was coded from scratch, as it was a tool we used to compile all of our client-side (and I think server side files) for our old project GTA:Life. On top of that, the resource was made a month before actually being released onto the MTA community. The reason for releasing: We decided to not continue the project due to the complexity and time required to get a playable version of the game mode ready in order for release.
  12. Add an export clientside to call the server, and then trigger the event to the client to fix this. Delaying it can still be unpredictable due to the download rate of the client
  13. removeAccountData also exists btw
  14. Any errors/warnings reported into debugscript?
  15. addEventHandler ( 'onPlayerWeaponSwitch',root, function ( _,aMyWeapon ) local curWeapon = getPedWeapon(source) if isElementWithinColShape( source, zone1 ) and curWeapon == 38 then toggleControl( source,'fire',false ) outputChatBox ( "You Can not use This Weapon in this Event", source, 255, 100, 0,true ) else toggleControl( source,'fire',true ) end end ) Give this a try
  16. 1B0Y

    lua

    Ideal way to learn Lua is to create small little scripts and start using some of the functions that are present in the Wiki. Learning the functions and seeing how they work is your foot into the door of scripting Lua. Once you get comfortable of these functions, you can then start to develop a mindset to the features you want to design. For example: Bank System: What do I need? set/getAccountData GUI (or commands?) Validation technique (such as checking if the player has the correct amount of money before depositing, and vise-versa from the bank account) ... Hopefully this should help yah
  17. addEventHandler("onPlayerLogin",root, function() local account = getPlayerAccount(source) setElementData(source,"account",getAccountName(account),true) --Syncs to the client end end) Setting the 4th argument to true will sync the element data from the server to client.
  18. function setAccountCoinValue(player,amount) if not player or not (isElement(player)) then return false end --Prevents errors from occuring when the player element isn't defined. local account = getPlayerAccount(player) --Make sure the player is logged in if isGuestAccount(account) then return false end --Set the coins value in the player's account setAccountData(account,"coins",amount) return true end function getAccountCoinValue(player) if not player or not (isElement(player)) then return false end local account = getPlayerAccount(player) if isGuestAccount(account) then return false end return getAccountData(account,"coins") or 0 end Create a function to call these functions when the player joins, quits, and when the player's coin value is changed to save it to their account
  19. As far as I am aware, there's no function available to calculate the total size of client resources that will be downloaded when the player joins the server. However, you can calculate this by looping through all the resources of the server, then parsing the client files from the meta and then calculating the size of each file to come up with a total with the use of the File functions. Give it a try
  20. serverContainer.loginClient = function(user,pass) if not serverContainer.connection then error("No DB connection to query.") end serverContainer.connection:query( function(query) local results = query:poll(0) for _,row in pairs(results) do local salt = row.salt local username = row.username local password = row.password print("Username:"..username..",Password:"..password.."") if salt and username and password then local newPass = md5(md5(salt):lower()..md5(pass):lower()):lower() if newPass == password then triggerClientEvent(source,'onClientSuccessfullyLogin',source) userData("success",player,user,pass) end end end end,"SELECT * FROM mybb_users WHERE username=?",user ) end addEvent('onClientLogins',true) addEventHandler('onClientLogins',root,serverContainer.loginClient) The problem was that you weren't taking advantage of callbacks. using dbPoll(query,-1) locks up the server until the MySQL query is completed. Callbacks doesn't have the lockup effect. Also - you were missing serverContainer.connection, hence the error above.
  21. onClientResourceStart -> createMarker -> setElementData to the markers with the gate ID. onClientMarkerHit -> getElementData of that marker to retrieve the code -> show keypad panel (via CEGUI) onClientGUIClick (enter) -> Check code between the one entered by the user, to the one assigned on the marker. If true -> setElementPosition. -> else, throw an error. Simple
  22. local Access = { ["None"] = true, ["*-*"] = true, } function warpAll(player) local account = getPlayerAccount(player) if not account or isGuestAccount(account) then return false end if not (Access[getAccountName(account)]) then return false end --You can output an error here as well, as long as you use return to stop the function. for i, player in ipairs(getElementsByType("player")) do local x,y,z = getElementPosition(player) setElementPosition(player,x+math.random(-3,3),y+math.random(-3,3),z) end end addCommandHandler("warpall",warpAll) Here yah go, enjoy.
  23. v1 and v2 are returning nil. I'm guessing that you're calling this from the server, which in this case, you need to send the data in the trigger for v1 and v2.
  24. mysql_ping is based on an old MySQL plugin that we used to use before it was built into the MTA itself. That script is really dated as the plugin no longer works and hasn't done for years lol. Rewrite it and use the new MySQL functions which can be found on the forum.
×
×
  • Create New...