Jump to content

tosfera

Members
  • Posts

    1,193
  • Joined

  • Last visited

Everything posted by tosfera

  1. You're using; "marker_create[v.uid]" to insert the data into the table, why aren't you just using the first argument of the loop as the index? Or just simply use table.insert so they still get ordered because the 'uid' is an auto increment field in your sql.
  2. tosfera

    IP Login

    That's account bounded, he wants to do it to the IP of the player. which is... kinda stupid, if you ask me.
  3. tosfera

    Question

    Why the hell are you doing this with matching colors? Rather just create a 'team' for the guys of the base and check the team. It is way easier! On your method, you can get conflicts with different bases.
  4. Loop trough the elements with the type 'vehicle' with getElementsByType, after that use setElementFrozen.
  5. You filled theVehicle at line 3-8. Why are you getting it again at line 10?
  6. indeed, all you had to do was add this; local vehicle = getPedOccupedVehicle ( player ) or replace the maveric with; getPedOccupiedVehicle ( player )
  7. tosfera

    INT or LONG

    He means in SQL. I would just use INT. I know, that's what I said. lua is only using int, bool, string and nil, so no trouble there. Only thing is, "Saving them into the database does require the right type". Since the function returns an INT, I'd go for the INT too... might not have been clear, soz. ^^"
  8. tosfera

    INT or LONG

    Lua is only using 'local's' which can be; int, bool, string and nil ( you got a few more, just aint being used that much ). Lua is declaring a double / decimal as an int too ( positions ). Saving them into the database does require the right type. And 'int' is an floating number ( 1, 2, 3, 4, etc ). And since the function says this; "Returns an integer containing the number of milliseconds since the system the server is running on started. This has the potential to wrap-around.", you'll have to use an int.
  9. If that doesn't work, you can also set the start of your new line at the end of your file by counting it. It's a dirty trick but I used it several times; function writeLog ( text ) if not ( fileExists ( "logs/logs.txt" ) ) then fileCreate ( "logs/logs.txt" ); end file = fileOpen ( "logs/logs.txt" ) if ( file ) then pos = fileGetSize( file ); newPos = fileSetPos ( file, pos ); writeFile = fileWrite ( file, text .."\n" ); if ( writeFile ) then fileClose ( file ); else outputDebugString ( "Error writing the logs." ); fileClose ( file ); return false; end end end
  10. The mysql functions are server sided, not client sided. Therefor player will not have the files with your queries nor username/password/host from your database.
  11. Ehmm just attach the element to the player and save the created object as an element to the player, when you want to detach it get the object from the element data, and use the getElementPosition to get its position.
  12. A function can be made local, look at this example: local function testFunction () end Each function you create without the 'local' will automaticly be created as a 'global' function. I have no idea what's the exact difference between them but there is something haha. Maybe it's because of the scope for other files, but not sure if this is because of the OOP version of LUA...
  13. No one will be scripting for just 'admin' if it comes to RP scripts, why should they let you own a server and get some donations for yourself while they only get 'admin'. They can just write it theirselfs and get everything for their own. Goodluck though.
  14. It works for me, there must be anything else wrong in your script mate. Just this part of your script doesn't work when people don't have a team ( like me ); if ( getPlayerTeam ( hitPlayer ) == getTeamFromName ( "Mechanic" ) ) then Just make sure people always have a team.
  15. You create 2 files; meta.xml and client.lua. In your client.lua you'll script the functions and the addEventHandler. In your meta you'll say that you have 1 script and 1 file ( search the wiki for this ). And you place the .mp3 in the same map ( create a new one for all the files ofc ) as your client.lua and meta.xml. That's all.
  16. https://wiki.multitheftauto.com/wiki/OnClientExplosion Love you.
  17. Will the OnClientObjectDamage cover the fuel stations? Like, make them non-explodeable.
  18. tosfera

    DxDrawImage

    Oke, just thought that I should've let you know because you said: "it uses OOP", haha. Sorry, enough off topic.
  19. tosfera

    DxDrawImage

    I do have to tell you this; "Lua is not really an object-oriented langauge, and it doesn't have a built-in concept of classes. ". So it's not actualy OOP. With the basic knowledge of tables and LUA you can add this. Because: "But it is easily possible to create your own class system using tables and metatables." Source; http://lua-users.org/wiki/ObjectOrientationTutorial
  20. tosfera

    question

    You can, you just have to create a function to see if you're actualy hovering the item while you use onClientClick function isHoveringItem ( x, y, minx, maxx, miny, maxy ) return x >= minx and x <= maxx and y >= miny and y <= maxy; end
  21. Hi guys, So I've been having trouble with hitting objects, like a vehicle hits an object or whenever a player smashes an object or shoots at it. There is a way to cancel it already ( breakable option ) but we can't use it as a real function / event already. There is a onClientPlayerDamage but that only works for players. I'd like to cancel the effect if a player drives into a tree or a lightpole. Any chance that the dev's could make this or is there already something like this? ^^ ( if it's not there I'm going to bribe, mwuahahah ) - Thanks
  22. destroyElement, onVehicleExplode ( blowVehicle also triggers the function ) and restarting the source which spawned the vehicle destroys the vehicle. So it does also destroy the elementData.
  23. Turn off any map files and turn them on one by one, after that see what map it's causing the 'bug'.
  24. You can do that, on the client render you should use some math functions and if-statements to make the text size increase and decrease.
  25. The arg = the first argument. Your command will be right now; /setpos arg 0 0 5 remove the 'arg' part.
×
×
  • Create New...