Jump to content

Jaydan

Members
  • Posts

    32
  • Joined

  • Last visited

Everything posted by Jaydan

  1. This is good, a few decent servers out there which struggle to gain recognition.
  2. Make sure you've given the admin resource permissions in the ACL.
  3. You could use the if operator to check the weapon: addEvent( "headboom", true ) function Zheadhit ( ped,attacker, weapon, bodypart) if weapon == WEAPONHERE or weapon == WEAPONHERE then if (getElementData (ped, "zombie") == true) then killPed ( ped, attacker, weapon, bodypart ) setPedHeadless ( ped, true ) end end end addEventHandler( "headboom", getRootElement(), Zheadhit ) But it is cleaner to use a table and use the if operator on the table like below: local weaponsBoom = { [WEAPONHERE] = true, } addEvent( "headboom", true ) function Zheadhit ( ped,attacker, weapon, bodypart) if weaponsBoom[weapon] then if (getElementData (ped, "zombie") == true) then killPed ( ped, attacker, weapon, bodypart ) setPedHeadless ( ped, true ) end end end addEventHandler( "headboom", getRootElement(), Zheadhit )
  4. There isn't a createCarWithMinigun() function, you'll have to learn Lua if you want to make this. Learning involves time.
  5. Any function can be important, it just depends on what you're making. https://wiki.multitheftauto.com/wiki/Sc ... troduction -- Functions & Events https://wiki.multitheftauto.com/wiki/Cl ... _Functions https://wiki.multitheftauto.com/wiki/Se ... _Functions https://wiki.multitheftauto.com/wiki/Cl ... ing_Events https://wiki.multitheftauto.com/wiki/Se ... ing_Events https://wiki.multitheftauto.com/wiki/Useful_Functions https://wiki.multitheftauto.com/wiki/Element_tree -- Learning the actual language http://nova-fusion.com/2012/08/27/lua-f ... rs-part-1/ It is important that you understand the basic syntax for Lua as well as understanding MTA's framework.
  6. I think I get what you're saying You would need to use https://wiki.multitheftauto.com/wiki/OnClientWeaponFire to find the element which was hit, if it was hit then use setWeaponAmmo To give them the bullet back.
  7. Jaydan

    Local

    Well, it would make your script more readable but every time you create a variable it stores it in the memory so technically speaking I guess it would be more efficient if you didn't assign a variable to it. Either way the performance isn't going to increase/decrease greatly so do whatever you prefer
  8. function redirectOpenPanel(source) triggerClientEvent(source, "openPanel", source) end Without putting source in the parameters how is it going to know what 'source' is? You also forgot to put source as the first parameter in the triggerClientEvent function, without doing that it would send it to every client. Also make sure your meta.xml file is correct, if you aren't sure post it below.
  9. 07/12/2014 --------- ~ You can now lock/open your homes with the GUI. ~ Added a check to verify that it is the owner locking the house.
  10. No it isn't when multi lining strings you use [[ text here ]].
  11. Er? Exported? https://wiki.multitheftauto.com/wiki/IsVehicleLocked https://wiki.multitheftauto.com/wiki/SetVehicleLocked
  12. GUIEditor = { window = {}, memo = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(572, 238, 337, 226, "Cheats And Codes Help Panel", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.memo[1] = guiCreateMemo(9, 24, 318, 192, [[-- Multi Theft Auto Cheats And Codes -- Cheat Code Commands: /power - Gives you 100 power. /rhino - Creates a tank for you. /givemejetpack - Gives you a jetpack. /givemeweapons - Gives you many weapons. /moneymoneymoney - Gives you 1000000 money. /policecantgetme - Sets your wanted level to 2. /jumpjet - Creates a hydra for you. /toodamnhot - Sets weather to scorching hot. /professionalkiller - Sets your weapon stats to max. ]], false, GUIEditor.window[1]) guiMemoSetReadOnly(GUIEditor.memo[1], true) end ) bindKey ( "o", "down", function ( ) guiSetVisible ( GUIEditor.window[1], not guiGetVisible ( GUIEditor.window[1] ) ) showCursor ( guiGetVisible ( GUIEditor.window[1] ) ) end ) Edit; fixed your typos on the bindKey function. GUIEditor_window = {} GUIEditor_memo = {} function LoadGui() GUIEditor_window[1] = guiCreateWindow(572, 238, 337, 226, "Cheats And Codes Help Panel", false) guiWindowSetSizable(GUIEditor_window[1], false) GUIEditor_memo[1] = guiCreateMemo(9, 24, 318, 192, [[-- Multi Theft Auto Cheats And Codes -- Cheat Code Commands: /power - Gives you 100 power. /rhino - Creates a tank for you. /givemejetpack - Gives you a jetpack. /givemeweapons - Gives you many weapons. /moneymoneymoney - Gives you 1000000 money. /policecantgetme - Sets your wanted level to 2. /jumpjet - Creates a hydra for you. /toodamnhot - Sets weather to scorching hot. /professionalkiller - Sets your weapon stats to max. ]] , false, GUIEditor_window[1]) guiMemoSetReadOnly(GUIEditor_memo[1], true) end addEventHandler("onClientResourceStart", resourceRoot, LoadGui) function showGui() if (guiGetVisible ( GUIEditor_window[1] )) then guiSetVisible(GUIEditor_window[1], false) showCursor(false) else guiSetVisible(GUIEditor_window[1], true) showCursor(true) end end addCommandHandler("cheatcodeshelp", showGui)
  13. Development has now restarted.
  14. Development has been paused as I am currently working on a project for another server.
  15. You need an event, how else is it supposed to get the player lol. https://wiki.multitheftauto.com/wiki/Se ... ing_Events so say you want to make it sync with the mysql database when a player joins, you' do handler = mysql_connect("localhost", "root", "", "arizonadrift") function playerJoined() local accountname = getPlayerAccount( getPlayerAccount( source ) ) local driftpoints = driftpoints local query = dbQuery ( database, "SELECT * FROM driftpoints WHERE accountname = '" .. accountname .. "' ") local result = dbPoll ( query, -1 ) local points = result[1]["points"] mysql_query(handler, "UPDATE users SET driftpoints = '" .. driftpoints .."' WHERE accountname = '" .. accountname .. "' ") end addEventHandler ( "onPlayerJoin", root, playerJoined )
  16. You'd use dbPoll and dbQuery local query = dbQuery ( housedb, "SELECT * FROM drift_points WHERE accountname = ''" .. accountherelol .. "" ) local result = dbPoll ( query, -1 ) local points = result[1]["points"]
  17. should be Well atleast you managed to find the issue
  18. Can't really understand what you're saying, if you mean can you use it on your server then yes as it is open source.
  19. It's work in progress, means that I am still working on the resource and it'll be released when I'm finished.
  20. This isn't a finished resource, there would be no point in downloading this. However, I managed to fix the command.
  21. local driftpoints = driftpoints erm, you need to set that something. so you are trying to get driftpoints from internal.db? and about the error, could you post your meta.xml as well?
  22. Could you send a snippet? Can't help you unless I see the code. If you don't want it shown publicly you can always inbox me.
  23. so i need to put that into my register script? and what you mean whit that? the internal.db? No, that script wouldn't work alone, it's just to give you an idea of what you need to do. So you'd make a table called users in your mysql database, then in your register script you'd make it insert the user into the database/table. then when you want to update driftpoints you'd do local handler = mysql_connect("localhost", "root", "password", "database") local accountname = getAccountName( getPlayerAccount( player ) ) local driftpoints = driftpoints mysql_query(handler, "UPDATE users SET driftpoints = '" .. driftpoints .."' WHERE accountname = '" .. accountname .. "' ") Or something simular.
  24. I will be starting work on an open source housing system, as this is open source I'll be updating this page with snippets, updates and features. The main reason for this topic is so I can get feedback on what you'd like to see and what could be improved. Please post below any ideas you may have, or if you think there is a better way I could be doing stuff. You'll be given full credit for any contributions you decide to make. How will I create a house? Simple, You just type /addhouse and the system will then generate a random interior and dimension. This makes it easier for mass house creation. Folder Structure: - RPhousing --Client ---gui.lua --Server ---commands.lua ---core.lua ---database.lua ---houseFunctions.lua --Shared ---data.lua --Ext ---housing.db VIEW SOURCE https://github.com/MagicMayhemC/HousingSYS Planned features; - Basic Features You'll be able to lock, sell and enter your home. - Housing Storage You will have the ability to store items in your house. UPDATES: - You can now enter and leave houses I will be updating this topic daily with a list of updates, feel free to contribute to this development. Screenies;
×
×
  • Create New...