Jump to content

Skuleris

Members
  • Posts

    29
  • Joined

  • Last visited

About Skuleris

  • Birthday 05/05/1999

Details

  • Location
    Latvia

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Skuleris's Achievements

Advanced Member

Advanced Member (8/54)

1

Reputation

  1. ----client side addEventHandler("onClientColShapeHit", resourceRoot, function() local id = getElementData(source,"item_ID") -- end) --server side function createItemInMap(item, name, x, y, z) createObject(item, x, y, z) local colSphere = createColSphere(x, y, z, 1.5) local item_ID = 1 setElementData(colSphere, "item_ID", item_ID, true) end When creating colshape, set its elementData. Use resourceRoot to trigger event only with colShapes created within the same resource.
  2. Not right. Use 10 instead of 0.0.3 Tip: use /debugscript to see detailed error code. Not hard to figure out yourself! You will have to format returned x,y to be on the edge of resolution.
  3. You can use optional argument 'edgeTolerance' of getScreenFromWorldPosition. If 'location point' is out of screen, function will return screen x,y position outside of screen resolution. You only have to format returned x,y to be on edge of screen resolution. https://i.imgur.com/tkVGLBX.png It will return false if 'location point' is behind the screen.
  4. You can do spawnLocation[1][1], spawnLocation[1][2]... as Patrick told you to. Or use unpack: spawnPlayer(source,unpack(spawnLocation[1]))
  5. Try to replace line 63 with sendMessageToNearbyPlayers(source, "blockedChat", message)
  6. That works, because instead of client doing action, the server does. Client can't, because the clientside files aren't downloaded yet.(I'm not sure if onPlayerJoin is the right one, maybe onPlayerConnect) function update() setCameraMatrix(source, -1360, 1618, 100, -1450, 1200, 100) showChat(source, false) end --updated as gSub told to. addEventHandler("onPlayerJoin", getRootElement(), update) Because the clientside isn't ready, you cant use client functions like setSkyGradient, setTime and setWeather, only server functions. Well you can, but that would set effect for every player.
  7. Use event "onPlayerJoin". Remember, that you can use only server-sided function while he didn't download the client files.
  8. There isn't function as clientTriggerEvent. Use triggerClientEvent. Also, you have to add first argument. Use this, remember to change player to your defined argument. triggerClientEvent(player, "LoginType", player, "register")
  9. Yes, the problem is in line 6. replace "player_Spawn" with "onVehicleLocked". addEventHandler ( "onVehicleLocked", getLocalPlayer(), onVehicleLocked ) WARNING:sound\sonidoS.luat:6: Bad argument @ 'addEventHandler' [Expected function at argument 3, got nil] The problem is told there. Expected function at argument 3, got nil. Argument 3 is player_Spawn, argument 2 is getLocalPlayer() and so on. You got on argument 3 nil = nothing. That may be, because "player_Spawn" isn't added as a function.
  10. function getPos() local x, y ,z = getElementPosition(localPlayer) local pos = tostring(x..", "..y..", "..z) outputChatBox(pos, 255, 100, 100, false) setClipboard(pos) end addCommandHandler("pos", getPos)
  11. local pos = { [1]= {200,200,200,1}, [2]= {100,100,100,2}, [3]= {500,500,500,3}, } addEventHandler ( "onPlayerJoin", getRootElement(), function(source) local spawn = math.random(1,3) local x,y,z,r = unpack(pos[spawn]) spawnPlayer(source, x, y, z, r) end ) Change pos table with needed positions, fourth row is rotation.
  12. I think you used getScreenControlPos function? Try instead guiGetPosition
  13. Have you tried dividing lenght by distance?
  14. --gui.lua:232 local imgX, imgY = getControlScreenPos(wnd) wnd.onclick((x - imgX)/wnd.width, (y - imgY)/wnd.height, btn) I figured out that this is where it calculates clicked position. getControlScreenPos returns the window offset to x,y locations. x,y position is 400,80 and gui offset is 200,50. You subtract from clicked position offset position and get exactly map position, which is divided by window size.
  15. addEventHandler("onClientGUIClick", guiRoot, function(button, state, absoluteX, absoluteY) if source == mapImage then local relX, relY = guiGetSize(mapImage, true) local x = relX*6000 - 3000 local y = 3000 - relY*6000 local hit, hitX, hitY, hitZ = processLineOfSight(x, y, 3000, x, y, -3000) guiSetText(mapXedit, x) guiSetText(mapYedit, y) guiSetText(mapZedit, hitZ or 0) end end) Maybe this
×
×
  • Create New...