Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by Ace_Gambit

  1. Your only work-around at the moment is find the right shooting animation and do the rest manually with effect and audio functions.
  2. Erm... typo But, seriously stop posting if you don't have anything to say. This isn't a chat box. Absolute to relative example: screenWidth, screenHeight = guiGetScreenSize() imageWidth = 50 imageHeight = 50 relImageWidth = imageWidth / screenWidth relImageHeight = imageHeight / screenHeight
  3. Relative sizes are usually calculated by dividing the absolute value by the value relative to. Just imagine your GUI window has a width of 200 pixels and the resolution of your screen is 800 x 600 pixels. The relative value is 200 / 800 = 0.25.
  4. That's exactly my thought. Ideally you can add/remove tasks at runtime (something like setNPCTasks ( table tasks )) and have a less obvious way with xml files. The latter is primarily meant for NPC's that perform a fixed list of tasks (like shop owners).
  5. NPC Animation Classes 0.2 Getting Started Extract npcac.zip to the root folder of your resource. The most recent version is attached at the bottom of this post. Now add the following lines to meta.xml. This is required. <script src="npcac/shared/include/const.inc" type="server" /> <script src="npcac/shared/include/type.inc" type="server" /> <script src="npcac/shared/include/util.inc" type="server" /> <script src="npcac/shared/objects/CPath.obj" type="server" /> <script src="npcac/shared/objects/CAnim.obj" type="server" /> <script src="npcac/shar
  6. The reason it doesn't go in a straight line is because the update interval is not fast enough to correct the turn velocity. The vehicle is constantly "pushed" in the right direction but it "overshoots" the facing angle because it can't correct the heading fast enough. Ideally you would do this client-side every time a new frame is rendered. But because there is no such thing server-side it looks as if it's swinging from left to right.
  7. Just keep in mind that the math used in this example is really rough and dirty. I am sure most of it can be done in less lines of script. But it may help you anyway.
  8. Have a look at this. http://forum.multitheftauto.com/viewtop ... 91&t=24188 It's a very basic example of moving a vehicle server-side (without any obstacle checking).
  9. Yea well. There is a major difference between needed and wanted. Your server isn't going to crash if you can't pick special character skins. And besides, there are more than enough skins to go with atm. It's just an addition you'd like to have. But like someone said before, this has been discussed so many times it's not even funny. And every time we came to the same conclusion. It's very unlikely it will happen before 1.0 so give it a rest.
  10. Why? It's not that important if you compare it to optimizing synchronization and other more serious issues.
  11. My best guess is he's going to ask why his screen remains black when he joins his server.
  12. That's not true. You can call setTimer anywhere and anytime you want. Even when it's in the body of your script.
  13. Ace_Gambit

    max value

    bla = {} bla[500] = "player1" bla[1000] = "player2" bla[2000] = "player3" print(bla[table.maxn(bla)].." has the highest score.")
  14. I honestly think this thread is going in the wrong direction. We are in the scripting section of the forums. Maybe it's best you seek help somewhere else, seriously.
  15. Dude, these are so sweet. What editor are you using?
  16. Let me help you a out a little bit. But please don't take this for granted and learn to understand. -- client script function onPlayerWasted() if (source == getLocalPlayer()) then setGameSpeed(0.15) setTimer(setGameSpeed, 5000, 1, 1) end end addEventHandler("onClientPlayerWasted", getRootElement(), onPlayerWasted, true)
  17. You can drop the cheating argument because other players can't see modified weapon handling anyway.
  18. function destroy ( wut ) for i = #board, 1, -1 do if ( board[ i ] == wut ) then destroyElement ( board[ i ] ) table.remove ( board, i ) break end end end
  19. You also may want to have a look at this for future reference. http://www.gtagarage.com/mods/show.php?id=1053 http://www.steve-m.com/downloads/tools/mapviewer/
  20. The syntax is wrong. INSERT INTO applications ( User, IGN) VALUES ( '" ..tostring(name) .. "', '" ..tostring(ign).. "')
  21. Well obviously because you close the connection after the queries without re-establishing the connection. So you either have to figure out if you want to connect every routine or open the connection once in your script and use that connection handle (the method I would recommend).
  22. I think it is a scope problem. Variable "insert_the_app" is declared as local inside your if/then/else clause. It is not known outside of that scope. function loadDatabaseAndMakeItWriteAble(text, text2, text3, country, thePlayer) local insert_the_app = false if ( not select_the_applications_database ) then outputChatBox("The database is unreachable, im sorry.") else outputChatBox("I connected to your database!") insert_the_app = mysql_query(con_my_sql, "INSERT INTO applications ( User) VALUES ( '" ..tostring(text) .. "' ) ")
  23. Which one of these two is line 31? mysql_free_result(select_the_applications_table) -- Freeing the result is IMPORTANT mysql_free_result(insert_the_app) -- Freeing the result is IMPORTANT
  24. I'd recommend changing the ID field to type INT and auto-increment the primary key. `ID` INT(9) NOT NULL AUTO_INCREMENT
  25. The problem is probably related to your database table structure (unique indexes or keys). What does the "applications" table structure look like?
  • Create New...