Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. You didn't answer my question. Does it only happen when you use MTA paradise game mode?
  2. x,y = guiGetScreenSize() window = guiCreateWindow((x-200)/2, (y-400)/2, 200, 400, "Player List", false) scrollpane = guiCreateScrollPane(0, 20, 200, 400, false, window) addEventHandler("onClientResourceStart", root, function () for k,v in ipairs(getElementsByType("player")) do guiCreateLabel(0, k*15, 200, 15, tostring(getPlayerName(v)), false, scrollpane) end end ) function clear () for k,v in ipairs(getElementChildren(scrollpane)) do destroyElement(v) end for k,v in ipairs(getElementsByType("player")) do outputChatBox ( "Adding: ".. getPlayerName ( v ) .." to list!" ) guiCreateLabel(0, k*15, 200, 15, tostring(getPlayerName(v)), false, scrollpane) end end addEventHandler("onClientPlayerJoin", root, clear) addEventHandler("onClientPlayerQuit", root, clear) addEventHandler("onClientPlayerChangeNick", root, clear) Tell me what does it output now.
  3. And it only happens with MTA paradise game mode?
  4. x,y = guiGetScreenSize() window = guiCreateWindow((x-200)/2, (y-400)/2, 200, 400, "Player List", false) scrollpane = guiCreateScrollPane(0, 20, 200, 400, false, window) addEventHandler("onClientResourceStart", root, function () for k,v in ipairs(getElementsByType("player")) do guiCreateLabel(0, k*15, 200, 15, tostring(getPlayerName(v)), false, scrollpane) end end ) function clear () outputChatBox ( getPlayerName ( source ) .." has ".. ( eventName == "onClientPlayerQuit" and "left" or "joined" ) .." the server" ) for k,v in ipairs(getElementChildren(scrollpane)) do destroyElement(v) end for k,v in ipairs(getElementsByType("player")) do guiCreateLabel(0, k*15, 200, 15, tostring(getPlayerName(v)), false, scrollpane) end end addEventHandler("onClientPlayerJoin", root, clear) addEventHandler("onClientPlayerQuit", root, clear) addEventHandler("onClientPlayerChangeNick", root, clear) See what it outputs on chat when your friend joins/leaves.
  5. Donde pusiste "X, Y, Z".
  6. You mean that the objects don't appear until you re-enter the interior?
  7. function startDelayedResource ( ) local resource = getResourceFromName ( "licencia" ) if ( resource ) then startResource ( resource ) outputChatBox ( "The resource 'licencia' is now running!" ) else outputChatBox ( "The resource 'licencia' doesn't exist!" ) end end setTimer ( startDelayedResource, 1000, 1 )
  8. The problem is here: Barrancas> It doesn't allow spaces.
  9. Eso no tiene mucho que ver con lo que vos queres hacer, no tomes un ejemplo que no es lo que vos queres, se te complica mas.
  10. It didn't remove on who's screen?
  11. addEventHandler, ya que addEvent se usa para cuando creas eventos propios.
  12. You can try this resource: https://community.multitheftauto.com/in ... ils&id=614 It's used to create gates and they can be restricted to teams. Keep in mind that is an old resource, I'm not sure if it still works.
  13. local myShader local startTickCount = 0 local lastEffectTic = 0 addEventHandler( "onClientResourceStart", resourceRoot, function() -- Version check if getVersion ().sortable < "1.3.1-9.04939" then return end -- Create shader myShader, tec = dxCreateShader ( "fx/ped_shell_layer.fx", 0, 0, true, "ped" ) if not myShader then else -- Apply shader to local player engineApplyShaderToWorldTexture ( myShader, "*", localPlayer ) -- Hack to make GTA render the ped last, so our shell effect appears on top of the background setElementAlpha( localPlayer, 254 ) end end ) ---------------------------------------------------------------- -- Start effect here ---------------------------------------------------------------- function startEffect ( ) startTickCount = getTickCount() lastEffectTic = getTickCount ( ) end addCommandHandler ( "droga", startEffect ) ---------------------------------------------------------------- -- Update effect here ---------------------------------------------------------------- addEventHandler ( "onClientRender", root, function ( ) if ( not myShader ) then return end local timeElapsed = ( getTickCount ( ) - startTickCount ) local f = ( timeElapsed / 750 ) local f = math.min ( f, 1 ) local alpha = math.lerp ( 1.0, 0.0, f ) local size = math.lerp ( 0, 0.3, f ) -- Expand shell dxSetShaderValue ( myShader, "sMorphSize", size, size, size ) -- Fade out shell dxSetShaderValue ( myShader, "sMorphColor", 1, 0, 0, alpha ) if ( startTickCount ~= 0 and getTickCount ( ) - lastEffectTic >= 1000 ) then startTickCount = getTickCount ( ) lastEffectTic = getTickCount ( ) end end ) ---------------------------------------------------------------- -- Math helper functions ---------------------------------------------------------------- function math.lerp(from,to,alpha) return from + (to-from) * alpha end
  14. https://wiki.multitheftauto.com/wiki/Sc ... troduction https://wiki.multitheftauto.com/wiki/Resources And by "open only to fire figher members" you mean players in a team?
  15. Scripts don't go on map files, you must create a .lua file and add it there.
  16. It is showing it, but you just put it way too high: scrollpane = guiCreateScrollPane(0, 20, 200, 400, false, window) with that, it works.
  17. To get all players around you, you can calculate their distance with: getDistanceBetweenPoints3D or: getDistanceBetweenPoints2D Or you can also use colshapes: createColTube getElementsWithinColShape
  18. Castillo

    Help!

    You can change that on "race/modes/base.lua", but you'll require of scripting knowledge.
  19. I don't really understand your question, to check positions just use the same ones you used to draw it.
×
×
  • Create New...