Jump to content

ds1-e

Scripting Moderators
  • Posts

    636
  • Joined

  • Days Won

    8

Everything posted by ds1-e

  1. I scanned with Dr. Web about 40~ minutes ago. Like i said above, killing rundll32.exe helps, after MTA starts or quiting game.
  2. My PC is clean, after running MTA it can't start normally, i need to kill MTASA.exe, after it runs, but when playing/joining any server, i have much FPS loss. No matters, which server. After quiting game, CPU usage it's still high, not a single case. My log: https://pastebin.mtasa.com/135780539 Another log: https://pastebin.mtasa.com/166441243 One more log: https://pastebin.mtasa.com/117936912 Me, and my friends have Windows 7. EDIT: Killing rundll32.exe helps. This is temporary solution.
  3. I believe that's happening because timer is going all the time, removing event handler doesn't make that timer will be destroyed. Timer is set for 1 ms interval, and unlimited times to execute. https://wiki.multitheftauto.com/wiki/SetTimer Try to assign timer to variable, and kill it after removing event handler, with: https://wiki.multitheftauto.com/wiki/KillTimer
  4. Any errors/warnings? Show removeEventHandler line.
  5. Try. function medicGO(source) local players = getElementsByType("player") for i = 1, #players do local player = players[i] local player_job = getElementData(player, "Job") or false if player_job and player_job == "Medic" then outputMessage("#ffffff[ Clientes #ffffff] - #FFFFFFO Jogador #ffffff"..getPlayerName(source).." #ffffffChamou Por um Samu", player, 255, 255, 255, true) outputMessage("#ffffff[ Clientes #ffffff] - #FFFFFFDigite /Localizar "..getPlayerName(source).." #ffffffPara Marcar O Jogador No Mapa", player, 255, 255, 255, true) end end end addCommandHandler("medic", medicGO) EDIT: Why do u attach two functions to one command? You could do it in one.
  6. ds1-e

    "Zoom" camera

    Yes, probably something like this, however, i don't know if am using it wrong, because still it doesn't give me same result like: setCameraTarget(getLocalPlayer()) does, so lookAtX, lookAtY, lookAtZ still depends from where player looks.
  7. ds1-e

    "Zoom" camera

    Hey, thanks. One more question related with camera, how can i get lookX, lookY, lookZ (i need same or similar result to setCameraTarget(getLocalPlayer())). Shortly, behind player back, no matters where's looking at.
  8. I would like to make it simpler, instead of using math.floor + math.round, if possible. I use this with onClientRender.
  9. Integer. Convert integer. For example: 12000 > 12 11000 > 11 5000 > 5 1000 > 1 less or equal to 999 > 0
  10. Hey, i would like to know if using (local) variables, have any affect on performance, in onClientRender. For example. Code like this: local table = {value = 12000} -- onClientRender local value = table.value dxDrawText(value) It's better than this? Or it doesn't really matter. local table = {value = 12000} -- onClientRender dxDrawText(table.value)
  11. Hey, any idea how to make this simpler? math.floor(math.round(player_blood/90/(90000/90/90), 2)).."L" -- this thing -- function math.round(number, decimals, method) decimals = decimals or 0 local factor = 10 ^ decimals if (method == "ceil" or method == "floor") then return math[method](number * factor)/factor else return tonumber(("%."..decimals.."f"):format(number)) end end
  12. Sorry, i can't help you. At the moment i don't know much about database functions.
  13. Poszukaj w skrypcie, nic innego nie mogę Ci poradzić. Potem jak znajdziesz zarzuć tutaj kod używając 'Code'.
  14. https://wiki.multitheftauto.com/wiki/IsGuestAccount / https://wiki.multitheftauto.com/wiki/GetPlayerAccount + https://wiki.multitheftauto.com/wiki/OnPlayerChangeNick This will work only if player will change nick, and it wouldn't check for the first nickname. So you would need to save nick, when player register, in database for example.
  15. O ile mapa nie jest edytowana, to skrypt tym zarządza/blokuje. Bez kodu nie wywróżę, także nie jestem pewny. Jak chcesz ustawić dla poszczególnej grupy, to po prostu dodaj warunek do funkcji przypisanej do tej komendy.
  16. 1. Server-side, uprawnienia jeżeli chodzi o ACL to: https://wiki.multitheftauto.com/wiki/IsObjectInACLGroup 2. Prawdopodobnie gui-label, szukaj w kodzie. 3. https://wiki.multitheftauto.com/wiki/SetPedControlState / https://wiki.multitheftauto.com/wiki/ToggleControl
  17. Works, thank you so much
  18. Going over and over, colshape don't need to be moved, i just need to set new one: -- with playerTable.player.colshape = saved_col -- set new col For example: 1 (actual player colshape) -> 2 -> 3 -> 4 -> 5 -> 6 -> 7 -> 8 -> 9 -> 10 -> 1 -> 2 -> 3 and so on. 3 (actual player colshape) -> 4 -> 5 -> 6 -> 7 -> 8 -> 9 -> 10 -> 1 -> 2 -> 3 and so on. To make things more understandable, let's say i have a lot of colshapes in one place, after i click button, it switch to next, without moving from place (standard colshape system isn't good enough.)
  19. I will need your advice once again So i will need to switch colshapes between them, all are in table. This code allows to switch only between 1st and 2nd in table. for i = 1, #playerTable.player.savedcols do local saved_col = playerTable.player.savedcols[i] if saved_col ~= playerTable.player.colshape then -- if colshape in table it's different from actual player col playerTable.player.colshape = saved_col -- set new col refreshLootInventory(playerTable.player.colshape) break end end For example, 10 colshapes in table. Switch from 1st, to 10th. If it reach 10th, start over.
  20. It's already attached to onClientRender within render events.
  21. Yes, even with else. But i noticed something, for some reason it only happens, after entering 3rd colshape or more. EDIT: I changed conditions a bit, and it's working, if something will change i will give u answer Thank you for your time. Fixed [?] code: for i = 1, #playerTable.player.savedcols do local saved_col = playerTable.player.savedcols[i] if colshape == saved_col then break end if colshape ~= saved_col and i == #playerTable.player.savedcols then table.insert(playerTable.player.savedcols, colshape) end end
  22. Why not. In total i will have less than 5 time task. (all of them will be active if needed - only.) local painTick = getTickCount() -- OnClientRender if playerTable.player.pain then -- only if boolean == true if getTickCount() - painTick > 3000 then painTick = getTickCount() -- do my stuff. end end end
  23. Hey, as topic say, which is better to use? Let's say i need to check something every 5 seconds, unlimited times. Will be better to use setTimer, every 5 seconds, and unlimited executes or check that in OnClientRender, like: my_variable == true then getTickCount() and do my stuff?
×
×
  • Create New...