-
Posts
6,097 -
Joined
-
Last visited
-
Days Won
218
Everything posted by IIYAMA
-
Well maybe you should mind the differences. -- why make a loop at clientside? You can't check other players their packetlossTotal at client side. for player, i in pairs --etc. -- server getNetworkStats(player) -- or player is nill for the server network. -- client getNetworkStats() - HD 7970 - CPU Type QuadCore Intel Core i7, 3700 MHz (37 x 100) (hyperthreading) - Module Name Corsair CML32GX3M4A1600C10 8 GB X 4 I am not laggy at all. Gta san is for that system a pathetic game. I am only play it, because I can modify it. But some people are playing at very weak pc's(especially laptops) . A little bit script performance would be welcome. I already told you that I use getTickCount()! I even use table(tickcount) timers to manage respawn from the players.
-
pls copie correctly. addEventHandler ( "onPlayerQuit", root, function (quiteType)--onPlayerQuit local playeraccount = getPlayerAccount(source) if not isGuestAccount ( playeraccount) then setAccountData(playeraccount,"number",exports.bone_attach:getElementBoneAttachmentDetails(object[source]) ) end end) addEventHandler ( "onPlayerLogin", root, function ()--onPlayerLogin local playeraccount = getPlayerAccount(source) local playermoney = exports.bone_attach:isElementAttachedToBone(object[source]) local number = getAccountData(playeraccount,"number") if playermoney then end end)
-
All players have an account, even the ones that did not login. but only people that aren't logged in do have a GuestAccount. (not login) if not isGuestAccount ( account ) then -- check if the player is logged in.
-
Try this: addEventHandler("onClientPreRender",root, function () local element= getPedContactElement ( localPlayer ) if element and getElementType(element)== "vehicle" and getControlState ("fire") then setControlState ( "fire", false) end end)
-
yep. https://wiki.multitheftauto.com/wiki/Ge ... actElement
-
Well there is something new: ( I haven't tried it yet) https://wiki.multitheftauto.com/wiki/SetObjectMass Maybe it helps, I don't think it will work with objects that can't be moved. You also can try: https://wiki.multitheftauto.com/wiki/MoveObject
-
-- Only check your self. addEventHandler("onClientPlayerDamage", getLocalPlayer(), myFunction) addEventHandler("onClientPlayerDamage", localPlayer, myFunction) -- the same. localPlayer = getLocalPlayer() --Yes getLocalPlayer()/localPlayer is only client. -- Check every single player. addEventHandler("onClientPlayerDamage", getRootElement(), myFunction) addEventHandler("onClientPlayerDamage", root, myFunction) -- the same. root = getRootElement()
-
You forgot the rotation. spawnPlayer(source,x,y,z+.5,0,tonumber(skin),0) spawnPlayer (thePlayer, x, y, z, rotation, skinID,interior ) Try this: function saveStats() local account = getPlayerAccount(source) if not isGuestAccount (account ) then local Skin = getElementModel(source) setAccountData (account,"CMG2.skin",tostring(Skin) ) local x,y,z = getElementPosition(source) setAccountData ( account, "CMG2.Xpos", x ) setAccountData ( account, "CMG2.Ypos", y ) setAccountData ( account, "CMG2.Zpos", z ) end end addEventHandler("onPlayerLogout",root,saveStats) addEventHandler("onPlayerQuit",root,saveStats) addEventHandler("onPlayerLogin",root, function ()--loadStats local account = getPlayerAccount(source) local skin = getAccountData (account,"CMG2.skin" ) local x,y,z = getAccountData ( account, "CMG2.Xpos" ),getAccountData ( account, "CMG2.Ypos" ),getAccountData ( account, "CMG2.Zpos" ) if x and y and z then spawnPlayer(source,x,y,z + 0.5,0,tonumber(skin) or 0,0) setCameraTarget(source) fadeCamera(source,true,2.5) else --spawnPlayer(source,0,0,999999) --setCameraTarget(source) --fadeCamera(source,true,2.5) end end)
-
I did test it, and yes. It disappears. I also checked if it had something to do with the ped. (with runcode) But no it isn't because of the ped, it is probably because after you scaled the object it got bugged. It have something to do with the distance from your camera to the object. But also the direction of the camera. and no you can't fix it, it is a gta san bug or maybe mta object scale bug. I will recommend you to remove your script from the forum. (else little kids will go play with it) Sorry that it can't be fixed. (I deleted the script from my pc)
-
You have this problem with all objects? ( not much wrong with the code, only not really build on performance ) Some other things I did noticed about your code. -- you said server side. addEventHandler("onClientResourceStart", getRootElement(),--onResourceStart function () setInteriorSoundsEnabled(false) end ); -- you only have to index this one time: (local value is faster than re-index global tables for every single thing.) local myObject = object[source] -- try to use "elseif" if a > 1 then -- if elseif a < 1 then -- if not "if a > 1 then", then check again. end
-
You can set all objects to low lod, (as far I know) You only have to fill in the correct syntax: not low lod, but does have col: createObject ( id, x, y, z, 0, 0, 0, false) Is low lod, but does not have a col: createObject ( id, x, y, z, 0, 0, 0, true)
-
You also tried it without put it at your head? and what happens when you change it to a low lod object? createObject ( id, x, y, z, 0, 0, 0, true) -- low lod
-
ye I mean col. ( I call it coll.) https://wiki.multitheftauto.com/wiki/Se ... onsEnabled -- server/client https://wiki.multitheftauto.com/wiki/Se ... idableWith -- client
-
Maybe you should disable the coll. (so the camera won't get stuck)
-
It is just 1 timer at server side. I use(normally) tickcount but tickcount does not loop,,,.,.,.,. Loop on client render can also sometimes be laggy, now you use also GPU power to loop.(+1 event), of course it is the best solution at client side. @arezu ah yes, my bad. I wasn't really ..... and..
-
Jep, + 3 --not very efficient... setTimer(function ()--packetLossCheck for player,i in pairs(getElementsByType("player")) do if getNetworkStats(player)["packetlossTotal"] > 33 then kickPlayer ( player , "High PacketLoss. ") end end end, 1000 , 0)
-
If you can't be a little bit clearer I can't help you. Here a both you got a perfect caller. It your codes don't contain the correct information I will be very hard to help you. (script names etc.)
-
The function isn't defined. if exports['EGvehicles']: checkFrozen(player) then meta.xml <export function="checkFrozen" type="server"/> function checkFrozen(player) local vehicle = getPedOccupiedVehicle(player) if vehicle and getVehicleController(vehicle) == player then if isElementFrozen(vehicle) then setElementData(vehicle, "vehicle.handbrake", 0) setElementFrozen(vehicle, false) else setElementData(vehicle, "vehicle.handbrake", 1) setElementFrozen(vehicle, true) end end end Also calling onClientRender isn't a very good idea.
-
if exports['EGvehicles']:isElementFrozen(vehicle) then It means that the script that receives this export does not accept these. The function isn't defined.
-
As RoG}xXMADEXx said. Use txd workshop + photoshop(or something else) It will probably give more performance, while gaming.
-
or if you aren't able to compile it your self, you can also try: http://mta.dzek.eu/compiler/ It is probably better compiled when you use your own compiler.
-
or processLineOfSight
-
I don't think you understand what I mean. I am talking about something very simple. But now I know it is impossible, without using timers.
-
ah yes, but then I am sending this trigger. It doesn't really matter if it have been send, it was more meant to save data travel by preventing the trigger. Well it is just a trigger... but it is handy to know if there is a possibility to find a way to do this on client side, without using any extra bandwidth.
