Jump to content

0xCiBeR

MTA Team
  • Posts

    1,673
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by 0xCiBeR

  1. 0xCiBeR

    Functions

    As for the order check the export variables: bool scoreboardAddColumn ( string name, [ element forElement = getRootElement(), int width = 70, string friendlyName = name, int priority = slot after "name" column ] ) Priority is were you should set the order for the column
  2. Really? Do show then from wich url you downloaded it from..
  3. If you create a vehicle client-side, you won't be able to get inside since it's not syncronized with the server.
  4. No problem. Tho i'm insisting in the fact that you are creating vehicles client side and these won't be usable.
  5. No, you just have to add that event on the server side using: addEvent It would be easy to explain if you post you're code.
  6. Client: function MarkerHit( hitElement, matchingDimension ) local elementType = getElementType( hitElement ) if(getElementType(hitElement) == 'player') and getElementData(hitElement,"vehicle") == false and getElementData(hitElement,"trucker") == true then local x,y,z = getElementPosition(hitElement) createVehicle(403, x + 10, y, z, 0 , 0 , 180) setElementData(hitElement,"vehicle",true) elseif getElementData(hitElement,"vehicle") == true then outputChatBox("You have got already a vehicle or you're not a trucker"); end end addEventHandler("onClientMarkerHit", marker1, MarkerHit ) function TruckerGUI() local myWindow = guiCreateWindow ( 0.5, 0.5, 0.5, 0.4, "Trucker Job Menu", true ) local b1X = 0.180; local b1Y = 0.180; local b1Width = 0.15; local b1Height = 0.20; btn1 = guiCreateButton(b1X, b1Y, b1Width, b1Height, "Hire", true, hireWindow); addEventHandler ( "onClientGUIClick", btn1, btn1_Click, false) end addEventHandler("onClientMarkerHit", workmarker, TruckerGUI) function btn1_Click(hitElement, btn1, matchingDimension) local element = getElementType(hitElement); if btn1 == "left" and (getElementType(hitElement) == 'player') and getElementData(hitElement,"trucker") == false and getElementData(hitElement,"vehicle") == false then setElementModel(hitElement, 206); setElementData(hitElement,"trucker",true); triggerServerEvent("setteam",localPlayer) setMarkerColor(marker1, 255, 0, 0, 150); else end end Server: truckers = createTeam("Truckers", 222, 153, 25); unemployedteam = createTeam("Unnemployed", 0, 0, 0); marker1 = createMarker(872, -1208, 16, 'cylinder', 2.0, 255, 0, 0, 0) workmarker = createMarker(860, -1208, 16, 'cylinder', 2.0, 0, 255, 0 , 150); addEvent("setteam",true) addEventHandler("setteam",root, function () setPlayerTeam(source,truckers) end)
  7. Change the event to onColShapeHit as suggested by DNL and store every colShape into a table.
  8. Try This: function respawn() local accountname = getAccountName (getPlayerAccount(source)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then outputChatBox("***Respawning ALL Empty Vehicles In 10 Secs, get to your car to keep it***") setTimer(function () local vehicles = getElementsByType ( "vehicle" ) for k, vehicle in ipairs ( vehicles ) do local model = getElementModel(vehicle) if model ~= 435 or 450 or 591 then if checkEmpty( vehicle ) then local seats = getVehicleMaxPassengers(vehicle) resetVehicleIdleTime ( vehicle ) respawnVehicle ( vehicle ) end end end end, 10000, 1) end end addEvent( "respawn", true ) addEventHandler( "respawn", getRootElement(), respawn )
  9. 0xCiBeR

    Functions

    No that will not work. Try this, and if you get any errors post them: addEventHandler ( "onPlayerWasted", root, function( totalAmmo, killer, killerWeapon, bodypart, stealth ) if killer then local account = getPlayerAccount ( killer ) if killer ~= source then setAccountData( account,"killsdeathsratio.Kills",tonumber( getAccountData( account,"killdeathsratio.Kills" ) or 0 ) +1 ) setElementData( killer, "Kills", tonumber( getAccountData( account,"killsdeathsratio.Kills" ) ) ) setElementData( killer, "Ratio", tonumber(getElementData( killer, "Kills" )/getElementData( source, "Deaths") ) ) end else local accountSource = getPlayerAccount ( source ) setAccountData( accountSource,"killsdeathsratio.Deaths",tonumber( getAccountData(accountSource,"killsdeathsratio.Deaths") or 0 ) +1 ) setElementData( source, "Deaths", tonumber( getAccountData( accountSource,"killsdeathsratio.Deaths" ) ) ) setElementData( source, "Ratio", getElementData( killer, "Kills" )/getElementData( source, "Deaths") ) end end ) addEventHandler( "onPlayerLogin",root, function( thePreviousAccount, theCurrentAccount, autoLogin ) local account = getPlayerAccount ( source ) if not getAccountData( account,"killsdeathsratio.Kills" ) and not getAccountData( account,"killsdeathsratio.Deaths" ) then setAccountData( account,"killsdeathsratio.Kills",0 ) setAccountData( account,"killsdeathsratio.Deaths",0 ) end setElementData( source,"Deaths",tonumber( getAccountData( account,"killsdeathsratio.Deaths" ) or 0 ) ) setElementData( source,"Kills",tonumber( getAccountData( account,"killsdeathsratio.Kills" ) or 0 ) ) setElementData( source, "Ratio", getElementData( source, "Kills" )/getElementData( source, "Deaths") ) end )
  10. That's because in my script i asumed you already created the doors. You have to create them using createObject
  11. 0xCiBeR

    Functions

    getPlayerAccount setAccountData getAccountData
  12. Try something like this... local cols = { {"Military",110.199, 1757.300, 17, 20, 3}, {"TEAM2",110.199, 1757.300, 17, 20, 3} } for _, v in ipairs(cols) do local name,x, y, z, rad,h = unpack ( v ) tubes = createColTube(x, y, z, rad,h) setElementData(tubes,"team",name) end addEventHandler("onMarkerHit",tubes, function (hit,dim) if getElementType(hit) == 'player' then local team = getPlayerTeam(hit) local teamname = getTeamName(team) if 'Military' == getElementData(source,"team") then moveObject ( door, 2200, 110.299, 1756.400, 25.5 ) end end end)
  13. Encontré esto navegando por el foro: exports.scoreboard:addScoreboardColumn( 'Play Time' ) local t = { } local uTimers = { } function checkValues( source,arg1,arg2 ) if arg1 > 60 then t[ source ][ 'min' ] = tonumber( t[ source ][ 'min' ] or 0 ) + 1 t[ source ][ 'sec' ] = 0 elseif arg2 > 3600 then t[ source ][ 'sec' ] = 0 t[ source ][ 'min' ] = 0 t[ source ][ 'hour' ] = tonumber( t[ source ][ 'hour' ] or 0 ) + 1 end end function onPlayerLogOut ( _,account ) if ( account ) and not isGuestAccount ( account ) then local sValue = getElementData( source,'Play Time' ) setAccountData ( account, "Play Time", tostring( sValue ) ) end if isTimer( uTimers[ source ] ) then killTimer( uTimers[ source ] ) end uTimers[ source ] = nil t[ source ] = nil end function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local sValue = getElementData( source,'Play Time' ) setAccountData ( playeraccount, "Play Time", tostring( sValue ) ) end if isTimer( uTimers[ source ] ) then killTimer( uTimers[ source ] ) end uTimers[ source ] = nil t[ source ] = nil end function subFind( str,mod ) if mod == 'hour' then return str:sub( 1,str:find( ':' ) -1 ) else return str:sub( str:find( ':' ) + 1,str:len( ) ) end end function onPlayerLogin (_, account ) if account then uTimers[ source ] = setTimer( function( player,acc ) local time = getAccountData ( acc, "Play Time" ) if time then if not t[ player ] then t[ player ] = { ["hour"] = tonumber( subFind( time,'hour' ) ), ["min"] = tonumber( subFind( time ) ), ["sec"] = 0 } end else if not t[ player ] then t[ player ] = { ["hour"] = 0, ["min"] = 0, ["sec"] = 0 } end end t[ player ][ 'sec' ] = tonumber( t[ player ][ 'sec' ] or 0 ) + 1 checkValues ( player, t[ player ][ 'sec' ] or 0, t[ player ][ 'min' ] or 0 ) setElementData ( player, "Play Time", tostring( t[ player ][ 'hour' ] or 0 )..':'..tostring( t[ player ][ 'min' ] or 0 ) ) end, 1000, 0 ,source,account ) end end addEventHandler ( "onPlayerQuit", root, onPlayerQuit ) addEventHandler ( "onPlayerLogin", root, onPlayerLogin ) addEventHandler( 'onPlayerLogout',root, onPlayerLogOut ) Fíjate si te sirve...
  14. Por favor, no bumpeen temas viejos, es preferible que creen un thread nuevo.
  15. Por favor no hagan bump de temas.
  16. Eso no serviría ya que el blip lo estas creando con local y local solo existe dentro de la función en la que fue creado. Usa esto: function Nemesisbymanawydan ( ) nemesi = exports [ "slothBot" ]:spawnBot ( -1935.5480957031, 665.44055175781, 47.0, 90, math.random ( 300, 303 ), 0, 0, Nemesis, 38, "hunting", true ) setElementModel ( nemesi, 7 ) outputChatBox ("STARS!",getRootElement(), 255, 255, 255, true ) myBlip = (createBlipAttachedTo ( nemesi, 23 )) attachElements ( baz, nemesi, 0.2, 0.1, 0.5, 0, 90, 0 ) triggerClientEvent ( "nsound", root ) triggerClientEvent ( "nemesismissel", root ) setTimer( function() setElementHealth ( nemesi, 200 ) end, 1100, 0) end addEventHandler("onResourceStart", resourceRoot, Nemesisbymanawydan) addEvent("onBotWasted",true) addEventHandler("onBotWasted",getRootElement(), function (killer) if (source == nemesi) then givePlayerMoney(killer,math.random(4000,6000)) -- 4000, 6000 money for kill nemesis-- outputChatBox ( getPlayerName ( killer ) .. "matado a Nemesis",getRootElement(), 255, 255, 255, true ) destroyElement (myBlip) setTimer(Nemesisbymanawydan, 1000, 1) -- 60000 time for nemesis respawn in milliseconds-- end end)
  17. Por favor, no hagas mas de 1 post. Puedes probar mandar un mail a [email protected] explicando tu problema, haber que te dicen..
  18. La verdad que no puedo ayudarte si no es el firewall. Si podes acceder bien a otras paginas y servidores, es algo que deberías consultar directamente en los foros de los servidores con los cuales tienes problemas. De igual manera, por ahí a alguien mas le paso esto y encontró una solución, así que estate atento a tu post. Saludos.
  19. Sin irnos al offtopic, si te digo, puede haber un problema con tu firewall bloqueando el puerto, estoy indirectamente diciéndote que debes comprobar si no es eso. No hace falta aclarar paso a paso como hacerlo, ya que en la red, hay muchos tutoriales de como realizar este tipo de comprobaciones.
  20. Tu sarcasmo es poco constructivo, discúlpame si me mal interpretaste, puede haber un problema con tu internet y ademas tu firewall puede estar bloqueando el puerto de descargas de tu cliente.
  21. Para algo lineal de esa magnitud, es mejor usar getTickCount y Timers para setear una nueva posición a la linea. Siempre usando estos, fuera del onClientRender. Ej:(es un ejemplo con timers que consumira bastante memoria..) z = 13.3 setTimer(function () z = 13.3+1 end,1000,1) setTimer(function () z = 13.3+2 end,2000,1) function drawLaser() dxDrawLine3D ( 2490, -1679.7, z, 2490, -1660.4, z, tocolor(255,0,0,math.random(100,230)),math.random(1,1.-- s8) --> dxDrawLine3D ( 2485, -1679.7, 14, 2485, -1660.4, 14, tocolor(255,0,0,math.random(100,230)),math.random(1,1.-- s8) --> end addEventHandler("onClientRender",getRootElement(),drawLaser)
  22. Es un resource, que sirve para gestionar que mods descargar y cuales no. Así alivias la carga a tu servidor, y al mismo tiempo tienes todos los mods que quieras disponibles.
  23. Por favor, no se desvíen del tema. Su problema es que no se crean las turf zones, hablando claramente de las Radar Areas y no en este caso de los ColShapes.
  24. Con respecto a tu primer pregunta, puede utilizar esto: HTTP Mod Loader By xXMadeXx Con respecto a tu segunda pregunta, un gui usualmente se activa solo para un solo jugador a menos que triggees desde el server-side un evento en el client-side para todos los jugadores.
×
×
  • Create New...