
arezu
Members-
Posts
446 -
Joined
-
Last visited
Everything posted by arezu
-
Yes i know that, but i used outputChatBox to see if it was successfully set (setting element data doesn't work for some reason for the second one).
-
I have a problem with settings element data server sided. outputChatBox("set playing: "..tostring(setElementData(player, "race.playing", true))) outputChatBox("set ghostmode: "..tostring(setElementData(player, "race.ghostmode", true))) It says in chatbox: set playing: true set ghostmode: false There is no error in debugscript, so i dont know what the problem is. Also, race.ghostmode element data for vehicles work, but not for players.
-
1. Make sure you have spawnpoints. 2. Open map in editor, press on 'definitions' (the green book) and add race. 3. Press on 'map settings' (the earth with tools in front of it) in editor and press on 'gamemodes' tab and add race, press ok. 4. Press on 'map settings' again and press on 'gamemode settings' tab and change any value, then press ok. 5. Save map and test it.
-
try this?: setOcclusionsEnabled(false) use it after removing world objects
-
function getRunningMapAuthor() local runningMap = exports.mapmanager:getRunningGamemodeMap() if not runningMap then return end return getResourceInfo(runningMap, "author") end outputChatBox ("#FFFFFF|INFO| #00CD00Aktuelle Map: < #FFFFFF"..getMapName().."#00CD00 > by <#FFFFFF"..(getRunningMapAuthor() or "N/A").." 00CD00>", player, 0, 205, 0, true)
-
Try using it server sided instead. It works much better than client sided.
-
If you are using solidsnakes code, remember to use getLocalPlayer() (like you Jaysds1 did in his reply) instead of root, because otherwise it will trigger for every player that has the shooter in its streaming range.
-
here's simple camera moving: local camera = {} local currentCameraView = 2 local cameraView = {} cameraView[1] = 5 cameraView[2] = 10 cameraView[3] = 15 cameraView[4] = 20 camera.dist = cameraView[currentCameraView] camera.speed = 10 camera.x = math.rad(60) camera.y = math.rad(60) camera.z = math.rad(15) camera.maxZ = math.rad(89) camera.minZ = math.rad(-45) addEventHandler("onClientPreRender", getRootElement(), function() local x, y, z = getElementPosition(localPlayer) z = z + 0.2 local camDist = camera.dist local cosZ = math.cos(camera.z) local camX = x + math.cos(camera.x)*camDist*cosZ local camY = y + math.sin(camera.y)*camDist*cosZ local camZ = z + math.sin(camera.z)*camDist --[[ local hit, hitX, hitY, hitZ = processLineOfSight(x, y, z, camX, camY, camZ, true, false, false, true, false, false, false, false) if(hit)then camDist = getDistanceBetweenPoints3D(x, y, z, hitX, hitY, hitZ) camDist = camDist - 2 if(camDist > camera.maxDist)then camDist = camera.maxDist end if(camDist < camera.minDist)then camDist = camera.minDist end end camX = x + math.cos(camera.x)*camDist*cosZ camY = y + math.sin(camera.y)*camDist*cosZ camZ = z + math.sin(camera.z)*camDist --]] setCameraMatrix(camX, camY, camZ, x, y, z) end) addEventHandler("onClientCursorMove", getRootElement(), function(curX, curY, absX, absY) local diffX = curX - 0.5 local diffY = curY - 0.5 local camX = camera.x - diffX*camera.speed local camY = camera.y - diffX*camera.speed local camZ = camera.z + (diffY*camera.speed)/math.pi if(camZ > camera.maxZ)then camZ = camera.maxZ end if(camZ < camera.minZ)then camZ = camera.minZ end camera.x = camX camera.y = camY camera.z = camZ end) bindKey("change_camera", "down", function() currentCameraView = currentCameraView - 1 if(currentCameraView < 1)then currentCameraView = #cameraView end camera.dist = cameraView[currentCameraView] end)
- 1 reply
-
- 1
-
-
you dont have to concentrate on the math if you just use: getElementMatrix(element)
-
ofc it doesn't work. What you are trying to do is almost like this: s = getTickCount() - getTickCount() and you are asking why its 0.0000000000001
-
whats the point of making invisible roads? its only confusing.
-
you can use: https://wiki.multitheftauto.com/wiki/Control_names
-
If you use onClientVehicleCollision, then you can get the impact force. Look on wiki example.
-
"ReFleX" version="1.0.3" type="script" /> "vehicle.txd" /> "vehiclelightson128.png" />
-
race is a big script, so its not recommended to make such a big change if you are not an experienced scripter.
-
You can create a ped and warp it into vehicle (or, make it enter the vehicle with control states).
-
false, you can use setElementData serversided and use getElementData to get it client sided. You can also use setElementData client sided and set the last optional argument to true to synchronize data with server, and then you should be able to use getElementData to get it on server sided scripts.
-
use ipairs when you have an indexed table like this: local ourTable = {} ourTable[1] = 3 ourTable[2] = "helloworld" ourTable[3] = "another" and pairs when your table looks like this: local ourTable = {} ourTable["helloworld"] = "this is an example" ourTable[2] = 3.14 ourTable[localPlayer] = 22 you can use pairs on the first example too, but its not sure if it will start on ourTable[1] and end on ourTable[3].
-
no debug error? lies, it should say: attempt to call nil value 'createBlipAttactedTo'. it should be createBlipAttachedTo
-
if there are no errors, then you should debug it yourself like this: local pGroup; call ( getResourceFromName ( 'scoreboard' ), 'addScoreboardColumn', 'Group' ); function addRoleToScoreboard() local data = getElementData(source, "role") dxDrawText("data: "..tostring(data), 500, 300) dxDrawText("police: "..tostring(police), 500, 350) if data == police then dxDrawText("data == police", 500, 400) pGroup = "Police Officer"; end dxDrawText("pGroup: "..tostring(pGroup), 500, 450) setElementData ( source, 'Group', pGroup ); end addEventHandler("onClientRender", root, addRoleToScoreboard)
-
I think he means that the fire disappears after a certain amount of time.
-
Make server sided scripts.
-
the easiest way is to just: local hunterDistance = currentDistanceToHunter/maxDistanceToHunter where currentDistanceToHunter is current distance between player and hunter pickup, and maxDistanceToHunter is distance between player spawn position and hunter pickup.