Jaydan
-
Posts
32 -
Joined
-
Last visited
Posts posted by Jaydan
-
-
Make sure you've given the admin resource permissions in the ACL.
-
Much better.
-
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 )
-
There isn't a createCarWithMinigun() function, you'll have to learn Lua if you want to make this. Learning involves time.
-
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.
-
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.
-
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
-
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.
-
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.
-
Actually its all because of the \n. You must stick the code together. * worst error when I saw it *
It should realy be reported.
No it isn't when multi lining strings you use [[ text here ]].
-
One more upload again from A-TEAM!
THANKS FOR 100+ DOWNLOADS!
Now this is a car locker!
Exported functions:
bool isVehicleLocked( element vehicle )
what does this do: Checks if a vehicle is locked
returned value: if yes returns true else returns false ( it also returns false if there were invalid arguements! Be carefull!)
vehicle: A element which is vehicle
bool setVehicleLocked( element vehicle, bool state, element player)
what does this do: Sets a vehicle to its locked state!
vehicle: A element which is vehicle
state: Can be true or false ( true for locking, false for no locking )
player: A element who will lock the vehicle and have keys!
returns: True if it was successfully done else false
Er? Exported?
-
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)
-
Development has now restarted.
-
Development has been paused as I am currently working on a project for another server.
-
hmm i have getting this error now
[2014-10-01 18:23:17] WARNING: drift\Driftdatabase.lua:1: Bad argument @ 'getPlayerAccount' [Expected element at argument 1, got nil] [2014-10-01 18:23:17] WARNING: drift\Driftdatabase.lua:1: Bad argument @ 'getAccountName' [Expected account at argument 1, got boolean] [2014-10-01 18:23:17] ERROR: drift\Driftdatabase.lua:14: attempt to concatenate local 'accountname' (a boolean value)
here is the script
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 )
-
hahaha ye first time i make this kinda fail lel never had it before
but if i wanne take the drift score from internal.db how can i do that?
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"]
-
oh lol i see now what i did wrong
should be
Well atleast you managed to find the issue
-
With the desire will use the completed resource on your server
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.
-
sorry
Did you complete the script as it will be referred to as an open-source?
It's work in progress, means that I am still working on the resource and it'll be released when I'm finished.
-
Hi, how to add cottage? command (sorry for bad english)
/addhouse = a nill valute
This isn't a finished resource, there would be no point in downloading this.
However, I managed to fix the command.
-
local accountname = getAccountName( getPlayerAccount( player ) ) local driftpoints = driftpoints local handler = mysql_connect("localhost", "root", "kolpol55", "arizonadrift") function aaa() dbQuery( myCallback, connection, "SELECT * FROM driftpoints" ) end function myCallback(qh) local result = dbPoll( qh, 0 ) -- Timeout doesn't matter here because the result will always be ready end mysql_query(handler, "UPDATE users SET driftpoints = '" .. driftpoints .."' WHERE accountname = '" .. accountname .. "' ")
thats what i have now
but its for now just testing
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?
-
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.
-
https://forum.multitheftauto.com/viewtopic.php?t=42067&f=148
Read that, next you would want to make a table with the following columns:
accountname, drift points
then you'd do something like
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 .. "' ")
something like that, then on your register script you should make it insert them into the users table or whatever.
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.
-
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;
Buy top 20 position in the MTA server browser for 20 days
in Servers
Posted
This is good, a few decent servers out there which struggle to gain recognition.