Jump to content

C0b0ll

Members
  • Posts

    15
  • Joined

  • Last visited

C0b0ll's Achievements

Square

Square (6/54)

0

Reputation

  1. I know this way, but it is on the client side. It is why i said: Thanks for your answer .
  2. Hi guys, I Try to add a model on the map, but I DON'T want to replace an existing model (then without using client functions like engineLoadTXD). Is it possible to create (from server side) the model 999999 for example ? Example of server code : importModel(999999, "data/MyModel.dff") createObject(999999, 0.0, 0.0, 15.0 ) Thanks
  3. Conclusion : It is not possible to have the stack trace on error... Ty all
  4. Hello, I want to print the entire stack trace for all error and warning. For the moment i only have the line number of the error/warning and I want more. I tried with debug.traceback, but it doesn't work. How can I print the entire call stack ? Thanks .
  5. From the server side, i have to use triggerClientEvent for all clients ? Like this : triggerClientEvent(getRootElement(), "startForward", mtaPed, mtaPed)
  6. Hello everybody, I try to move a ped using setPedControlState. My problem is that the ped is only moving correctly for the syncer client. For the others, the ped doesn't play any animation and he is teleported each 2 meters... Here is my client code : function startForward(mtaPed) setPedControlState(mtaPed, "forwards", true) end addEvent("startForward", true) addEventHandler("startForward", getRootElement(), startForward) What is wrong ? Thanks for your help .
  7. Hi, I read the code and the algorithm just select a way point closer of the destination than the current way point... I'll code my own bots and add the A* algorithm. Thanks for this script . +
  8. Download the last version of slothbot here Put the zip in "Your_MTA_directory\server\mods\deathmatch\resources\" directory. In your mtaserver.conf, add the reference to slothbot resource adding the following line : <resource src="Slothbot" startup="1" protected="0" /> In your client side mod, add the following line (do'nt forget to define the x, y and z variables) : exports.slothbot:spawnBot(x, y, z, 0) You should have a hunting bot on your server. +++
  9. Very nice script . I created a little script to add one hunting bot and I created some path in the map editor, but how to use my paths ? I tried to simply add the map file in my meta.xml : <map src="myWaypoints.map" dimension="0"></map> But the bot doesn't follow my defined paths. It is probably a stupid question, but I didn't find any answer to my question on the forum and Google. Thanks a lot.
  10. Hi, Thanks a lot, it is working ! It was so simple and I lost so many time. Bye <3
  11. Hi guys, I'm installing a test server on my VPS. I followed the tutorial on the MTA web site. Unfortunately, when i launch my server I have this message : The package is installed and I can find the so file in "/usr/lib/x86_64-linux-gnu/libsqlite3.so.0". Where should I create a symbolic link to fix my problem ? Thanks a lot, C0b0ll
  12. Thanks again for your help. I'll probably do it myself, but I have to learn more before .
  13. Thanks for your reply, Then, how to write unit testing for my MTA script ?
  14. Hi, Lua and MTA are new for me and I tried some peace of code. It is very powerful and particularly the unit testing. I read and tried the tutorial on UnitTesting (http://lua-users.org/wiki/UnitTesting) : -- Some super function to test function my_super_function( arg1, arg2 ) return arg1 + arg2 end -- Unit testing starts require('luaunit') TestMyStuff = {} --class function TestMyStuff:testWithNumbers() a = 1 b = 2 result = my_super_function( a, b ) assertEquals( type(result), 'number' ) assertEquals( result, 3 ) end function TestMyStuff:testWithRealNumbers() a = 1.1 b = 2.2 result = my_super_function( a, b ) assertEquals( type(result), 'number' ) -- I would like the result to be always rounded to an integer -- but it won't work with my simple implementation -- thus, the test will fail assertEquals( result, 3 ) end -- class TestMyStuff luaUnit:run() When I execute this code, the "compilator" (i'm using SciTO editor) says me : What can I do to fix that problem ? Thanks a lot !
×
×
  • Create New...