-
Posts
768 -
Joined
-
Last visited
Everything posted by Drakath
-
I also had this problem but a computer restart fixed it for me. I assume you already tried that but if you didn't, be sure to do this.
-
Okay, also is it better to do the most controlling of a ped via server-side using setPedAnimation or via client-side using setPedControlState?
-
I quite often encounter desynced pedestrians. However today I checked them with getElementPosition and getElementSyncer and to my wonder, they had a syncer and position was correct but they were still invincible. I changed the syncer using setElementSyncer and then I was able to kill the ped. So how come pedestrians are desynced even though they have a syncer? Another problem is that I have a script which I put before spawning a ped so they don't spawn in radar areas: for theKey, radar in ipairs(getElementsByType("radararea")) do if getElementData(radar, "noPeds") then if isInsideRadarArea ( radar, x, y ) then return end end end It kind of works. Normal peds don't spawn there but desynced do. Why does the spawn code get executed even though I wrote return in the script above? Can anyone give me some tips on how to prevent desync?
-
Alright but does that mean that there is no 100 % chance that the ped will exist in that loop?
-
When I do: for i, ped in ipairs(getElementsByType("ped")) do end Is it possible that ped won't exist? Should I check it with isElement like so: for i, ped in ipairs(getElementsByType("ped")) do if isElement(ped) then end end ?
-
I'm still not sure which ray should I increase. I guess it's not the intTargetZ ray. Also, isn't 3 meters out of the matrix limits?
-
local t_Matrix = getElementMatrix (t_Data.ped) local int_RayX = t_Matrix[2][1] + t_Matrix[4][1] local int_RayY = t_Matrix[2][2] + t_Matrix[4][2] local int_RayZ = t_Matrix[2][3] + t_Matrix[4][3] for i = 1, 10 do local intSourceX, intSourceY, intSourceZ = t_PedPos[1], t_PedPos[2], t_PedPos[3] local intTargetX, intTargetY, intTargetZ = int_RayX, int_RayY, int_RayZ - 0.2 + i*0.2 dxDrawLine3D (intSourceX, intSourceY, intSourceZ, intTargetX, intTargetY, intTargetZ, tocolor(255,0,0,255)) end This script draws 10 lines of 1 meter length. How can I increase that length to 3 meters?
-
By the way, how can I increase the length of rays? local t_Matrix = getElementMatrix (t_Data.ped) local int_RayX = t_Matrix[2][1] + t_Matrix[4][1] local int_RayY = t_Matrix[2][2] + t_Matrix[4][2] local int_RayZ = t_Matrix[2][3] + t_Matrix[4][3] for i = 1, 10 do local intSourceX, intSourceY, intSourceZ = t_PedPos[1], t_PedPos[2], t_PedPos[3] local intTargetX, intTargetY, intTargetZ = int_RayX, int_RayY, int_RayZ - 0.2 + i*0.2 dxDrawLine3D (intSourceX, intSourceY, intSourceZ, intTargetX, intTargetY, intTargetZ, tocolor(255,0,0,255)) end This script draws 10 lines of 1 meter length. Let's say I want to increase that to 3 meters.
-
I got it working with processLineOfSight. Thank you all for helping
-
The example doesn't make them jump if an obstacle is right in front of them. It will make the ped jump only if he is 1 meter away from the obstacle. I want to make him jump even if he is 0 meters away.
-
Is it even possible to do this in GTA:SA?
-
What should I define in endX, endY and endZ?
-
And how do I get the position of the obstacle?
-
local x, y, z = getElementPosition(peds) local matrix = getElementMatrix (peds) local isPathClear = true for i = 1, 10 do isPathClear = isLineOfSightClear (x, y, z, matrix[2][1] + matrix[4][1], matrix[2][2] + matrix[4][2], matrix[2][3] + matrix[4][3] - 0.8 + i*0.2, true, true, false, true) if (not isPathClear) then break end end This script detects if there is an obstacle. I make my ped jump when it detects it. But this script only works if a ped is 1 meter away from the obstacle. How can I make it to work if ped is right in front of the obstacle?
-
I'll pm you my script and explain it better, alright?
-
Is it possible to use isLineOfSightClear if obstacle is right in front of ped (0 meters)? If yes then how?
-
Thanks for the information.
-
I have a script which uses about 15 getDistanceBetweenPoints3D functions. Would it be more efficient to make this function: function getDistToElement(element,Px,Py,Pz) local x,y,z = getElementPosition(element) return getDistanceBetweenPoints3D(Px,Py,Pz,x,y,z) end and use it instead of all other getDistanceBetweenPoints3D?
-
What is more efficient: This: function showMoney(source) local playermoney = getPlayerMoney ( source ) outputChatBox(playermoney) end or this: function showMoney(source) outputChatBox(getPlayerMoney ( source )) end Is it worth storing something in local if you are gonna use it only once?
-
It looks fine to me: http://i.imgur.com/Iy1BejU.png I am a concerned about the traffic though. Here are the specs: RAM: 4 GB Bandwidth: 100 Mbps (10000 GB per month) CPU: 3 vCores