-
Posts
1,140 -
Joined
-
Last visited
-
Days Won
41
Posts posted by Patrick
-
-
15 minutes ago, Killbean said:
Thanks for a tip - I had some resource that recalculated distance to all pickups every frame. I deleted it, but it still takes around -12FPS continuous. It is more efficient to call createPickup on server or client? Or for long term performance it does not matter?
Thanks!
If everyone has to see, call it on server side.
Try to find which resource use the most CPU with performancebrowser: https://wiki.multitheftauto.com/wiki/Resource:Performancebrowser
- use the following option to see detailed informations: d -
Hi. 170 markers should not cause continuous FPS drops, after creation.
Maybe you have an onClientRender event where you loop trough these markers in every frame? Or something similar?
- 1
-
@Maruchan (Please name your threads properly, instead of "help me pls". This isn't the first time I have renamed it. Thanks.)
-
1 minute ago, cocowen said:
but need to destroy the object by myself?
yes
-
Just now, cocowen said:
do not need detachAll anymore? just detach ?
No need detachAll before ped destroying anymore, it does it automatically for you. But test it please, the warning still appears or not?
-
1 hour ago, Patrick said:
You have to detach objects first with detachAll. (I'll fix it in next release)
@cocowen Probably fixed, can you try with latest version? download here
-
Just now, cocowen said:
yes , another question i trans from boneattach to pattch ,bind a weapon ak on player's right hand , when player hold the ak , its work nice ,but when its aim , the rotation is wrong , but its works find in boneattach , not sure if there is something need to do in pattach , do pattach fit for weapon?
pAttach and bone_attach use different parameters (different bone IDs / offsets), you have to reposition them. It isn't enough to just copy/paste them.
For weapons mostly you have to use:
addCommandHandler("testweapon", function(player) local object = createObject(356, 0, 0, 0) exports.pAttach:attach(object, player, "weapon", 0, 0, 0, 0, 0, 0) end)
-
2 minutes ago, cocowen said:
maybe i already find the problem: i destroy the ped ? so let info in table of pattach missed it ?
You have to detach objects first with detachAll. (I'll fix it in next release)
-
1 hour ago, cocowen said:
ok , i understand ,thanks u
local object = createObject(371, 0, 0, 0) setElementDimension(object,1) pAttach:attach(object, element, "backpack", 0, -0.15, 0, 90, 0, 0) WARNING: pAttach\client.lua:265: Bad argument @ 'isElementOnScreen' [Expected element at argument 1]
i set object to dim 1 , but it keep output this error
I can't reproduce it, can you send me a proper example resource?
... btw the problem is the ped (element), not the 'object'. Where 'element' defined, and is it on server or client side? -
2 minutes ago, cocowen said:
if i set attach from localplayer client , other player will see the attached object ,too?
If you attach object on client-side? No, others can't see it, only the client.
-
3 minutes ago, cocowen said:
most function is shared
whats the different from using function from client or server , do it same ? or client just work for local player
On client side functions return true or false, depeding on it was successful or not. (For example: attach returns true if objects attached successfully, and false if not)
But on server side (almost) always returns true, even if it failed. (because it returns the result of triggerClientEvent) -
33 minutes ago, gyrosos14 said:
Azon túl jutottam (végre). Most viszont a debugscript a következőt írta ki: WARNING: vg_accounts\server.lua:72: dbExec failed; (1062) Duplicate entry '0' for key 'PRIMARY'
Olyan sort próbálsz meg insertelni, aminek az elsődleges kulcsa már létezik egy másik sornál. Nem lehet két sorod azonos elsődleges kulcsal.
-
1 hour ago, gyrosos14 said:
Gondolom itt a mysql-hez kötéssel lesz baj nem?
Igen, ha külön resourceban van a csatlakozás, akkor azt a resource-t ("mysql") nem szabad újraindítani és elsőként kell elindítani.
-
2 hours ago, gyrosos14 said:
Ja igen, az if (#bans > 0) then -nél true-ra van állítva, de nem jó
Akkor meg rossz a query, mindig ad vissza sorokat. iprint-el írasd ki a bans táblát és nézd meg mi van benne, vagy phpMyAdmin-ban futtasd le kézzel a SELECT-et.
Lehetséges, hogy nem jó az expiraton és olyat is visszaad amit nem kéne. -
Nem adhat vissza true-t ha sehol nem returnolsz true-t, valahol máshol lesz vele valami.
-
Nem létezik olyan functionod, hogy 'attemptRegister'. triggerServerEvent-et akartál használni gondolom, csak elírtad.
-
7 minutes ago, Bean666 said:
indeed, it's working fine now too, it seldomly happens. idk why, but now it's all good, i'll update if it ever happens again, might've been just an error. thanks!
Wierd
-
9 hours ago, Bean666 said:
Could it be AK's getting affected by the anim loop stop? idk.. but i have the ID defined minigun on it.
Maybeee, idk. I tried to reproduce what you did in the video, but I can't. Works fine for me.
- 1
-
Wrong language, moved to Portuguese section.
-
Wrong language, moved to Spanish section.
-
Wrong language, moved to Portuguese section.
-
Wrong language, moved to Spanish section.
-
Is it works fine if you don't modify weapon property?
-
Ez ennél sokkal-sokkal bonyolultabb, teljesen rossz úton jársz, kevered a client és server oldali függvényeket is.
Ajánlom, hogy ezt hanyagold egy kicsit, tanulj/próbálj csinálni hasonló egyszerű dolgokat és utána térj vissza rá.
- https://wiki.multitheftauto.com/wiki/Main_Page
- https://wiki.multitheftauto.com/wiki/Scripting_Introduction
- https://www.lua.org/manual/5.1/
- https://wiki.multitheftauto.com/wiki/Category:Tutorials
- https://forum.multitheftauto.com/topic/34453-manuals- https://forum.multitheftauto.com/topic/64228-the-ultimate-lua-tutorial/
- https://forum.multitheftauto.com/topic/121619-lua-for-absolute-beginners
- https://forum.multitheftauto.com/topic/95654-tut-debugging/
- https://forum.multitheftauto.com/topic/114541-tut-events/
- https://forum.multitheftauto.com/topic/117472-tut-scaling-dx/
AFK system
in Scripting
Posted
You can use getPlayerIdleTime, thats make it really easy.