Jump to content

dzek (varez)

Retired Staff
  • Posts

    4,144
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by dzek (varez)

  1. you cannot create bot if you asking about that if you want THINKING bot, you will need A LOT of time spend on scripting, and the script will be HUGE
  2. "water color.lua" its better to avoid spaces in filenames, maybe this can help you well, the best filenames is just letters a-z numbers 0-9 _ [underscore] - [dash] and just one . [dot] for extension separation
  3. so you have nothing? did you try anthing btw? or wanting us to do that? make a gui, triggerServerEvent, and to save the info that window was already shown you can use account data, sql, or xml. and important information: when you change someones name, it will be restored for him/her after disconnecting. so if you do that window to prevent "Player"'s to be on server, thats not a good idea to show that window once
  4. that test was doing with http server, not mta, but i will test the speeds myself, and post results here. the link you posted is outdated (as we can read on the top of that page)
  5. Well, i didnt say that im 100% sure, but tests (not by me) showed that 1000 INSERT queries took 76 sec on sqlite, and less than 1 sec on myisam engine on mysql.. Reading is almost the same..
  6. sqlite bahaves in same way afaik rewriting whole database when storing data i told about mysql becouse maybe he dont know about mysql possibility?
  7. read 50p`s post again.. and fix that bugs.. and you have probably addional "end" at the end of script
  8. HELL! MTA-MySQL seems not allowing me to do two queries at once, so SET dont work too
  9. ok,but not player trigger that change name, so it wont be blocked clientside
  10. well, if you ever use MySQL you will be dissapointed with sqlite.. it dont offer too much, even if it looks different.. i bet on MTA-MySQL module the fastest, and the easier to manage sqlite isnt fast for writing, but not slow for reading
  11. tomdrum11, you should notice the edit button .. yea its possible, there was a canon resource (dont know exact name, search for it) you can use for that
  12. well, its ok now, as this was a bit bigger,than blocking the change and change it via script, and i do some "ifs" etc and its ok. thanks everyone
  13. events: onPlayerJoin onPlayerQuit functions: getPlayerMoney setPlayerMoney getElementPosition setElementPosition getPedSkin setPedSkin and you need to save this somewhere, SQL (search on wiki.multitheftauto.com) or accout data (setAccountData, getAccountData) or XML (search on wiki again)
  14. well, if you need to change max speed you can try to use setElementVelocity something like: if you need to reduce max speed, just temprarly disable "forward" key if speed is over your max and if you need to raise max speed just use getElementVelocity and setElementVelocity to multiply speed if player is pressing forward, and car is on ground (to prevent from flying), and speed is under your max
  15. you need more javascript as javascript also has events working like lua (especially in jquery) so bindKey has 3 parameters: 1st - the key 2nd - the state of key that trigger function ("down" mean when you press key down, "up" (not supported yet) when you release it, "both" (not supported yet)) 3rd - the function that handles that keypress you can do function function_showing_cursor(player, key, state) -- something there end bindKey("m", "down", function_showing_cursor) or bindKey("m", "down", function(player, key,state) -- something there end) ) (notice on the 1st example - when typing function that handles your keypress, you dont pass any arguments in (), it should be without () there - it could be your common mistake - im talking from view php programmer ) hope i helped you to understand
  16. oh, right lil Toady, thanks ;D that was so simple edit NO NO NO! this seems not to work function onPlayerChangeNick (old, new) outputDebugString("1") removeEventHandler("onPlayerChangeNick", getRootElement(), onPlayerChangeNick) setPlayerName(source, "something") addEventHandler("onPlayerChangeNick", getRootElement(), onPlayerChangeNick) end addEventHandler ("onPlayerChangeNick", getRootElement(), onPlayerChangeNick) this change my nick once, and get into infinite loop, console is spammed with "1" message, and after some sec in the game *NETWORK TROUBLE* appears.. this infinite loop isnt broke by some kind of protection in mta like in while (1~=2) do outputDebugString("2") end (something like that stops after about 1000 loops? not sure how much)
  17. same thing.. look at my edit.. you cant cancelEvent if nick change was caused by script (look at wiki) https://wiki.multitheftauto.com/wiki/OnPlayerChangeNick going to sleep now, ill try again tommorow
  18. i just did what is above.. and it changes the nick indeed, but its get an infinite loop, then C Stack Overflow well, your script stops infinite loop becouse of if ( string.find ( name, "#%x%x%x%x%x%x" ) ) then ..
  19. i know about that, but it cant help me .. function onChangeNick(old,new) cancelEvent() setPlayerName(source,new) end addEventHandler("onPlayerChangeNick", getRootElement(), onChangeNick) edit: wow, you edited ;p
  20. well, im trying to set nickname if somebody change his nickname (i dont want to block nickchanging btw) but when i add event handler to onPlayerChangeNick, and inside i chage his nick, im going into infinite loop im trying for 60 mins and no good results..
  21. 50p, original script is ok, ive used it when i was learning gui
  22. Zdzisiek, add all your files to meta.xml like that <file src="rc.dff"/> <file src="rc.col"/> <file src="rc.txd"/> then client-side script will do the job txd_beachsktp = engineLoadTXD ( "rc.txd" ) engineImportTXD ( txd_beachsktp, 666 ) col_corrimao2 = engineLoadCOL ( "rc.col" ) engineReplaceCOL ( col_corrimao2, 666) dff_part1 = engineLoadDFF ( "rc.dff", 0 ) engineReplaceModel ( dff_part1, 666 ) 666 is the original model ID you want to replace (remember you cant add new object, you need to replace one)
  23. probably a lame question, how to get all players in table to loop via ipairs? as there are functions like getAlivePlayers, getDeadPlayers, but i need all players
×
×
  • Create New...