-
Posts
636 -
Joined
-
Days Won
8
Everything posted by ds1-e
-
@IIYAMA Yes. I compare hash, if atleast one file doesn't have correct, i am breaking loop. This will definitely hurt server? I guess so.
-
Hi. I have a question encoding/decoding files. I keep decoding keys in table, after decoding all files table is cleared. (nil) I'm just wondering if client can get somehow a decoding key. If yes, then is there any way to avoid that?
-
Ah yes, big mistake Sorry.
-
Shouldn't it hurt only a player? Unless it triggers triggerServerEvent. Since server sync all players position and it's something normal for it - correct me if am wrong.
-
Check this topic, it's well explained, and it works very nice.
-
Yes i know about first thing. I was thinking that "report thing" exist somewhere else, in script file which isn't directly called admin_report, i am not sure why i missed gui folder , about "find all in all opened documents" - great feature, which i've never used, thanks. EDIT: I've just noticed, that nearly same feature exists also in Sublime Text 3, which i prefer to use.
-
Hey, how i can disable /report command? I want to use that for something else. I was looking and i couldn't find it.
-
Thanks, i will let you know, if something will not work. Besides, what do does in this case?
- 21 replies
-
- onclienthudrender
- onclientprerender
-
(and 1 more)
Tagged with:
-
About solution above. Don't use elementdata for such a thing, or even better, don't use it at all. Use tables - they are fast and efficient. local player_names = {} -- Assign name to player function onPlayerLogin() setPlayerName(source, "Alex_Hunter") player_names[source] = "Alex_Hunter" end addEventHandler("onPlayerLogin", getRootElement(), onPlayerLogin) -- Avoid any changes function onPlayerChangeNick(old, new, byuser) if player_names[source] then if old ~= new then setPlayerName(source, player_names[source]) -- you might replace it with cancelEvent(), it depends, read "Cancel event" note on https://wiki.multitheftauto.com/wiki/OnPlayerChangeNick end end end addEventHandler("onPlayerChangeNick", getRootElement(), onPlayerChangeNick) -- Clear data from table, after player quit function onPlayerQuit() if player_names[source] then player_names[source] = nil end end addEventHandler("onPlayerQuit", getRootElement(), onPlayerQuit)
-
function onPlayerLogin() setPlayerName(source, "Alex_Hunter") end addEventHandler("onPlayerLogin", getRootElement(), onPlayerLogin) Server-side.
-
First example. https://wiki.multitheftauto.com/wiki/RestartResource
-
Hey, if you could send it, this would be nice. Besides, i need to ask about other thing. I am thinking if i should choose client or server for that. I will use setTimer or getTickCount(), to make time function. First of all send trigger from server and later decrease it, each 1 minute. Here's the problem, because i don't know if i should decrease it on client, and send trigger to server, or simply do it on server-side (this is in setTimer case), about getTickCount() i am forced to do this on client anyways. I'm afraid if this is secure thing. I store all of data in tables (which are more secure than elementData, or i am wrong?), on server and client. Besides i've secured all of my triggers.
-
This problem still exist?
- 21 replies
-
- onclienthudrender
- onclientprerender
-
(and 1 more)
Tagged with:
-
1. If you are about damage when shooting glass. My solution: - Cancel damage on event which is responsible for player damage. * Simply check if player is in vehicle, and body part is 9. 2. I don't have idea for that. My solution: - setVehicleDamageProof, which also protects wheels. * Apply cancelEvent() for onClientVehicleDamage, damage vehicle by script.
- 1 reply
-
- 1
-
No. You use client-side event, and define client-side script as server-side. This won't work.
-
Change to client in meta.xml
-
https://wiki.multitheftauto.com/wiki/SetWeaponProperty
-
Maybe you could show us some code that in your opinion is guilty for that. I'm not a magician, and i don't know how it looks. At the moment, i can advice you to read this. Mainly for loops, unpack equivalent, and localize variables, but i don't think so that will be enough. https://springrts.com/wiki/Lua_Performance
-
https://wiki.multitheftauto.com/wiki/SetPedTargetingMarkerEnabled
-
Lua tables, check first post, i've edited it.
-
Hey, i would like to know which is faster, and better to use. Or there's no any difference in performance between them? For example in render, or any different usage. As far i understand from reading IIYAMA's posts, for render it's better to use array structure?
-
@slapz0r If you're considered about performance. You should use int loop. local players = getElementsByType("player") for i = 1, #players do local player = players[i] -- do your stuff end Source: https://springrts.com/wiki/Lua_Performance
-
That's what i am doing, compiling script with highest obfuscation level, and also i use cache="false" in meta.xml for client-side scripts, thanks for explaining.
-
As i thought, i wasn't sure about that. So at the moment, there's no any other extra possibility to "secure them more", excluding cache="false" and compiling with highest level of obfuscation?