Jump to content

Finijumper

Members
  • Posts

    68
  • Joined

  • Last visited

Everything posted by Finijumper

  1. Los dos archivos .lua que tiene el script son del client: Tendría que hacer otro que fuera el server-side?
  2. No se que estoy haciendo mal local root = getRootElement() boostTimer = false local currentlyBoosting = false function onCarDownResourceStart(resource) local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then bindKey("lalt", "down", startBoost) bindKey("lalt", "up", stopBoost) end end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onCarDownResourceStart) function startBoost (key, keyState) local vehicle = getPedOccupiedVehicle ( getLocalPlayer () ) if ( vehicle ) then if ( getVehicleController ( vehicle ) == getLocalPlayer () ) then boostTimer = setTimer(startCarBoost, 50, 0, vehicle) --outputChatBox ( "boostTimer=" .. tostring(boostTimer) ) currentlyBoosting = true else outputChatBox( "You need to be the driver!", 255, 0, 0 ) end end end function startCarBoost(vehicle) local vehSpeedX, vehSpeedY, vehSpeedZ = getElementVelocity ( vehicle ) setElementVelocity ( vehicle, vehSpeedX*1.05, vehSpeedY*1.05, vehSpeedZ*1.05) end function stopBoost( key, keystate ) if ( currentlyBoosting ) then --outputChatBox ( "boostTimer=" .. tostring(boostTimer) ) killTimer( boostTimer ) currentlyBoosting = false end end
  3. Dónde le pongo la función? : local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then
  4. Lo he intentado varias veces, pero no funciona la tecla cuando pongo el código.
  5. Me había equivocado, era esa parte del script la que quería restringir por eso no funcionaba local root = getRootElement() boostTimer = false local currentlyBoosting = false function onCarDownResourceStart(resource) bindKey("lalt", "down", startBoost) bindKey("lalt", "up", stopBoost) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onCarDownResourceStart) function startBoost (key, keyState) local vehicle = getPedOccupiedVehicle ( getLocalPlayer () ) if ( vehicle ) then if ( getVehicleController ( vehicle ) == getLocalPlayer () ) then boostTimer = setTimer(startCarBoost, 50, 0, vehicle) --outputChatBox ( "boostTimer=" .. tostring(boostTimer) ) currentlyBoosting = true else outputChatBox( "You need to be the driver!", 255, 0, 0 ) end end end function startCarBoost(vehicle) local vehSpeedX, vehSpeedY, vehSpeedZ = getElementVelocity ( vehicle ) setElementVelocity ( vehicle, vehSpeedX*1.05, vehSpeedY*1.05, vehSpeedZ*1.05) end function stopBoost( key, keystate ) if ( currentlyBoosting ) then --outputChatBox ( "boostTimer=" .. tostring(boostTimer) ) killTimer( boostTimer ) currentlyBoosting = false end end
  6. El scipt funciona, pero igualmente lo pueden hacer todos. Yo quiero que solo lo puedan hacer los Admins.
  7. Donde tendría que poner la funcion? local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then
  8. Muchísimas gracias También necesito restringir esto. Te agradecería que me ayudaras. local thisResourceRoot = getResourceRootElement(getThisResource()) function setCarSpeed ( cmd, boosts, speeds ) local boost = tonumber(boosts) local speed = tonumber(speeds) if boost >= 1 and boost <= 100 then outputChatBox ( "Speed boost set to " ..boosts.. ". Use /carspeed 0 0 to disable." ) carboost = (boost * 0.002) + 1 carbrake = (boost * 0.005) + 1 if speed ~= nil then local speedk = math.ceil(speed * 1.609344) local speedks = tostring(speedk) outputChatBox ( "Max speed set to " ..speeds.. "MPH / " ..speedks.. " KM/H. Use /carspeed [boost] [maxspeed] to change." ) carspeed = speed end addEventHandler ( "onClientRender", getLocalPlayer(), checkSpeed ) elseif boost == 0 then removeEventHandler ( "onClientRender", getLocalPlayer(), checkSpeed ) outputChatBox ( "Speed boost disabled." ) carboost = nil carspeed = 500 end end addCommandHandler ( "carspeed" , setCarSpeed ) function getPlayerSpeed( source, mode ) if (isPedInVehicle( source ) == true) then vehicle = getPedOccupiedVehicle( source ) if (mode == "MPH" or mode == 1) then return math.floor(getDistanceBetweenPoints3D(0,0,0,getElementVelocity(vehicle)) * 100 * 1.14) end if (mode == "KMH" or mode == 2) then return math.floor(getDistanceBetweenPoints3D(0,0,0,getElementVelocity(vehicle)) * 100 * 1.61 * 1.14) end else return 0 end end function checkSpeed() local vehicle = getPedOccupiedVehicle ( getLocalPlayer() ) if ( getControlState ( "accelerate") ) then local speed = getPlayerSpeed (getLocalPlayer(), 1) if speed >= 1 and speed <= carspeed then local vehicle = getPedOccupiedVehicle(getLocalPlayer()) local x, y, z = getElementVelocity(vehicle) setElementVelocity(vehicle, x*carboost, y*carboost, z) end end if ( getControlState ( "brake_reverse") ) then local speed = getPlayerSpeed (getLocalPlayer(), 1) if speed >= 38 then local vehicle = getPedOccupiedVehicle(getLocalPlayer()) local x, y, z = getElementVelocity(vehicle) setElementVelocity(vehicle, x/carbrake, y/carbrake, z) end end end function thisResourceStart () if carboost ~= nil then carboost = nil end carspeed = 500 end addEventHandler ( "onClientResourceStart", thisResourceRoot, thisResourceStart )
  9. ¿Como podría restringir el comando de este script para que solo los usen los Admins? function allvehiclesaredoomed() -- get a table of all the vehicles that exist and loop through it vehicles = getElementsByType("vehicle") for i,v in ipairs(vehicles) do -- destroy every vehicle. destroyElement(v) end end --The command handler below will destroy all vehicles once --you enter /vdoom in the chat box or vdoom in the game console. addCommandHandler("vdoom", allvehiclesaredoomed) --This is very useful if you use the freeroam resource and some --heartless players start spawn spamming. --You can also set it on a timer to have your server clear all --vehicles ever 60 minutes, (1 hour). Timer below: -- (treure --)setTimer(allvehiclesaredoomed, 3600000, 0) Se que no es difícil pero no consigo hacerlo
  10. A que te refieres en el runcode? Quiero decir que a que te refieres con "ejecutas eso en el runcode". Que es el runcode? Perdón por mi ignorancia.
  11. Os quería preguntar si sabéis de algún script que lo que haga es que los coches destruidos del mapa desaparezcan al cabo de unos minutos o simplemente poder hacerlo tu "a mano". Gracias.
  12. Respeto tu opinión, muy bien argumentada.
  13. Lol, pues explicádmelo por privado xP
  14. Se pueden copiar los scripts de otros servidores que no estén compilados?
  15. No hay alguna manera que en vez de que cuando escriban /sound les aparezca el menú lo puedan hacer pulsando solo una letra (ej. la tecla I)? addEventHandler("onResourceStart", root, --(En caso de cliente, el evento sería: "onClientResourceStart") function() bindKey("I", "down", "sound") end ) Y tengo que copiar eso en el SvSide?
  16. No hay alguna manera que en vez de que cuando escriban /sound les aparezca el menú lo puedan hacer pulsando solo una letra (ej. la tecla I)?
  17. Lo he visto y me gusta. Pero no habría alguno que se pudiera crear en el coche?
  18. Gracias Tengo una duda, este script hace que los otros puedan también escuchar tu música?
  19. Me gustaría saber si conocéis algún script que sea un reproductor de urls que acaben en .mp3, que cada usuario del servidor pueda agregar sus urls y que se escuchen en sonido 3d cuando estés dentro de un coche. Sino es exactamente así me gustaría que fuera parecido.
×
×
  • Create New...