-
Posts
866 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Mr_Moose
-
It's because of the freeroam resource which is named "play", simply use the command "/stop play", reconnect and you won't see the map selection dialog again.
-
There are many ways, either a shared mysql database since mysql can be accessed both by PHP websites like SMF and in game on a mta server. That could be useful for the punishments overview since it's a large amount of data that should be stored wherever it's needed most which is most likely on the webserver where everyone can see it. The other option is the php sdk: https://wiki.multitheftauto.com/wiki/PHP_SDK I would recommend the php sdk for the server info box, simply add the files to your webserver and run the sample code from the wiki just to see that it works, then you are able to pass arguments from your mta server to your webserver and vice versa. Your MTA server has lua functions to get that kind of info such as players online, max players, game mode and other info that will be easy to display online.
-
Replace from line 13 to this: if team and not isGuestAccount(account) then setAccountData(account, "team", getTeamName(team)) elseif not team then setAccountData(account, "team", getTeamFromName("Insert_teme_here")) end Personally I would use the solution provided by Cheez3D, but since that wasn't good enough for you, we're making it the hard way. This solves the special case but causes new issues if you want to have team less players too, which I wouldn't recommend, it's all up to you now.
-
You're not the owner of a script just because you are using it, and why do you expect it to work when you doesn't even care about reading it, even a noob would see the problem if they just read the code line by line.
-
You do know that lua code boxes on this forum include links to the wiki, https://wiki.multitheftauto.com/wiki/DxDrawImage, there's how you should use the dxDrawImage function, secondly it's all color coded, red means client side only, orange means server side and blue means shared (i.e works on both server and client). Got it? Good, then you might want to read a basic getting started guide in lua scripting, I wrote this: http://forum.404rq.com/index.php/topic,172.0.html#forum tutorial long ago and it seems to be up to date and useful in this case.
-
If you're using leaked scripts then you could at least figure that out by yourself, don't be lazy. See this maybe: https://wiki.multitheftauto.com/wiki/Server_Manual
-
There is nothing to script, just press H to toggle that light, like in single player.
-
I think he knows about adding the code to the client, it's all in the documentation of: triggerClientEvent The problem however is that the client files haven't been downloaded when onPlayerJoin is triggered server side which means that the client code doesn't exist yet. A better solution would be to use the client sided event: addEventHandler( "onClientResourceStart", getRootElement( ), function ( startedRes ) -- Client resources has finished downloading here. end );
-
It depends on what type of database you have, some say SQL even when they mean SQLite for instance, here's the syntax for all major databases: MySQL SHOW [FULL] TABLES [FROM db_name] [LIKE 'pattern'] Oracle SELECT * FROM dba_tables MSSQL SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' SQLite is like MySQL basically.
-
You have SELECT * SHOW TABLES in your code, it should only be SHOW TABLES if you want to list all tables in your database.
-
Works for trains too However the compiled version of that one won't load properly in MTA 1.4, I suggest that you do like in this train system, release it as open source, that would prevent many future issues.
-
You don't need to add anything actually, it's a complete resource. What you can do is to copy the data of your createObject function to the table according to the description in order to create a gate in a place you already chosen. Or try it out as it is by visiting LSPD garage and observe the gate there how it works according to the script.
-
And the second question, how about the "List" part in Gridlist, did you try to uppercase that L on line 5 yet? OOP classes usually uppercase the first char in all new words that is brought together. List is a word and Grid is a word so the name of that class could be GridList.
-
If it works for the window then I assume that you set: <oop>true</oop> In the server config file, for some reason it's often the most simple errors that causes the most trouble, I would try to figure out what "grid" in your code actually is, a "userData value" could be nil referring to an older syntax, or something else due to a misspelled class or function, try to replace Gridlist with GridList to see if the class name where misspelled, otherwise it's hard to say what the issue could be in this case.
-
-- All gates and their data gate = { -- ObjectID closeX closeY closeZ openX openY openZ rotX rotY rotZ colX colY colZ colRad Group Scale [1]={ 11327, 1587.7, -1638.4, 14.8, 1587.7, -1638.4, 20, 0, 0, 90, 1588, -1638, 10, 10, "ISA", 1 }, [2]={ 10671, -1631, 688.4, 9.587, -1631, 688.4, 20.187, 0, 0, 90, -1631, 688, 7.187, 10, "ISA", 2 }, [3]={ 11327, 2334.6, 2443.7, 7.70, 2334.6, 2443.7, 15.70, 0, 0, -30, 2334.6, 2443.7, 5.70, 10, "ISA", 1.3 }, [4]={ 11327, 2294, 2497.4, 5.3, 2294, 2497.4, 14.3, 0, 0, 0, 2294, 2497.6, 4.3, 15, "ISA", 1.2 }, } -- Global data members gates = { } cols = { } ocpenSpeed = 3000 -- Add all gates function mapLoad ( name ) for k=1, #gate do -- Create objects local gat = createObject( gate[k][1], gate[k][2], gate[k][3], gate[k][4], gate[k][8], gate[k][9], gate[k][10] ) local col = createColCircle( gate[k][11], gate[k][12], gate[k][13], gate[k][14] ) setObjectScale( gat, gate[k][16] ) -- Assign arrays of object pointers gates[col] = gat cols[col] = k -- Add event handlers addEventHandler("onColShapeHit", col, openGate ) addEventHandler("onColShapeLeave", col, closeGate ) end end addEventHandler ( "onResourceStart", getResourceRootElement(), mapLoad ) -- Gates open function openGate(player) local ID = cols[source] if isElement(player) and ( getElementData(player, "Group" ) == gate[ID][15] or getElementData(player, "Group" ) == "ACRP" ) or getPlayerTeam(player) == getTeamFromName("Staff") then moveObject(gates[source], ocpenSpeed, gate[ID][5], gate[ID][6], gate[ID][7] ) end end -- Gates close function closeGate(player) local ID = cols[source] if isElement(player) and ( getElementData(player, "Group" ) == gate[ID][15] or getElementData(player, "Group" ) == "ACRP" ) or getPlayerTeam(player) == getTeamFromName("Staff") then moveObject(gates[source], ocpenSpeed, gate[ID][2], gate[ID][3], gate[ID][4] ) end end A complete gate system with some predefined groups and gates on the police departments in all cities, source: http://forum.404rq.com/index.php/topic,242.0.html#forum
-
No idea to PM me about this, it's better to help more people if I'm going to help anyone, that's why I post my reply here instead, now to the solution, try this: Find this line: local veh = createVehicle( ... ) and add after: setElementData(veh, "owner", thePlayer) This assign a player element as the owner of the newly created vehicle Then you capture the onVehicleStartEnter event where you perform a check of the vehicle owner: function enterVehicle ( player, seat, jacked ) --when a player enters a vehicle if ( getElementData(source, "owner") and player ~= getElementData(source, "owner") ) then cancelEvent() outputChatBox ( "You don't have the keys for this vehicle", player ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle ) And there you have a lock system that limits based on players.
-
The problem remains, module or not, the syntax of that function isn't the same as in dbConnect, currently MySql support are built in so there is no point of using that kind of modules. BTW it's not completely unlike that the module is written in php after all. I would still recommend dbConnect for this.
-
Latest version: 2.0.0 will be found here: http://code.albonius.com/?action=download&id=568586d994ef88c80b2eb46b4860fc16 News: Upgraded to work with MTA 1.4 Using built in functions and removed it's out dated sync system written in lua. Added brown streak carriages and passenger trains Optimized parameters and made the trains spawn more common like in GTA SA single player Improved the difference between stop blocks and stations to make trains stop in the middle of the station and force it to stop when it reaches a stop block. Made the acceleration and deceleration smother at low speed (common issue in older versions).
-
mysql_query() is a php function and won't work in lua, see this: https://wiki.multitheftauto.com/wiki/DbConnect
-
You can try this one: https://community.multitheftauto.com/index.php?p=resources&s=details&id=8338, it's overkill for a DayZ server but it contains a lock system which uses a table with players as index and the setVehicleLocked function. Another option would be to use setElementData to assign a player as the owner of a vehicle and then validate upon enter during the onVehicleStartEnter event. If the owner doesn't match simply cancel that event and you'll have a working lock system.
-
I think you mean the server software, see this guide: https://wiki.multitheftauto.com/wiki/Installing_and_Running_MTASA_Server_on_GNU_Linux
-
It will still depend on how the group system is made, how it's table structure are and what names you are using on the tables, everything has to be correct in order to make it work. Sorry to say it but it won't work just like that. Either modify the turf system to work with your group system or modify your group system with a proper table structure to use the given solution, it's up to you.
-
Is that some kind of combined group and turf system or what do you have so far? The solution you tried will only work if you planning to install the AC turf system together with Sebbe (Smart) group system. If you're using another system or made your own then ofc it won't work. Post the full code, or at least the part where the table and storage structure are declared.
-
-- All gates and their data gate = { -- ObjectID closeX closeY closeZ openX openY openZ rotX rotY rotZ colX colY colZ colRad Group Scale [1]={ 11327, 1587.7, -1638.4, 14.8, 1587.7, -1638.4, 20, 0, 0, 90, 1588, -1638, 10, 10, "ISA", 1 }, [2]={ 10671, -1631, 688.4, 9.587, -1631, 688.4, 20.187, 0, 0, 90, -1631, 688, 7.187, 10, "ISA", 2 }, [3]={ 11327, 2334.6, 2443.7, 7.70, 2334.6, 2443.7, 15.70, 0, 0, -30, 2334.6, 2443.7, 5.70, 10, "ISA", 1.3 }, [4]={ 11327, 2294, 2497.4, 5.3, 2294, 2497.4, 14.3, 0, 0, 0, 2294, 2497.6, 4.3, 15, "ISA", 1.2 }, } -- Global data members gates = { } cols = { } ocpenSpeed = 3000 -- Add all gates function mapLoad ( name ) for k=1, #gate do -- Create objects local gat = createObject( gate[k][1], gate[k][2], gate[k][3], gate[k][4], gate[k][8], gate[k][9], gate[k][10] ) local col = createColCircle( gate[k][11], gate[k][12], gate[k][13], gate[k][14] ) setObjectScale( gat, gate[k][16] ) -- Assign arrays of object pointers gates[col] = gat cols[col] = k -- Add event handlers addEventHandler("onColShapeHit", col, openGate ) addEventHandler("onColShapeLeave", col, closeGate ) end end addEventHandler ( "onResourceStart", getResourceRootElement(), mapLoad ) -- Gates open function openGate(player) local ID = cols[source] if isElement(player) and ( getElementData(player, "Group" ) == gate[ID][15] or getElementData(player, "Group" ) == "ACRP" ) or getPlayerTeam(player) == getTeamFromName("Staff") then moveObject(gates[source], ocpenSpeed, gate[ID][5], gate[ID][6], gate[ID][7] ) end end -- Gates close function closeGate(player) local ID = cols[source] if isElement(player) and ( getElementData(player, "Group" ) == gate[ID][15] or getElementData(player, "Group" ) == "ACRP" ) or getPlayerTeam(player) == getTeamFromName("Staff") then moveObject(gates[source], ocpenSpeed, gate[ID][2], gate[ID][3], gate[ID][4] ) end end ^^ That one, works out of the box. If you followed the link you had it right in front of you. This won't require many brain cells to modify for your purposes.
-
You have an argument in dxDrawText after the color argument called "scale" that has the default value 1, it's not provided in your script but you'll find it on the wiki, if you set that to 2 for instance your text will be scaled to it's double size, the argument are of the type float so you can also use values like 0.7 or 1.4 as well, With that font I would recommend you to set the scale to 0.7 bool dxDrawText ( string text, float left, float top [, float right=left, float bottom=top, int color=white, float scale=1, mixed font="default", string alignX="left", string alignY="top", bool clip=false, bool wordBreak=false, bool postGUI=false, bool colorCoded=false, bool subPixelPositioning=false, float fRotation=0, float fRotationCenterX=0, float fRotationCenterY=0 ] )