Jump to content

brad

Members
  • Posts

    96
  • Joined

  • Last visited

Everything posted by brad

  1. ok gracias por la ayuda samt ,pero esta el problema de ke nose desactiva con el mismo boton ayudenme!!!
  2. alle algo pero nose como relasionarlo con este script me parece ke es en getPLayerName
  3. osea que de los colores delos jugadores como en el chat
  4. ok gracias man ,y como le ago para ke le agregue su color : D
  5. este es el script ,e intentado mucho local x, y = guiGetScreenSize () local localPlayer = getLocalPlayer() local spectatorSettings = { count = 7, -- how many player names to show, before showing "and x more" charLimit = 19, -- max limit of characters in player name xOffset = 200, -- how far to the left this should be yOffset = (y / 2) - 10, -- how far down the screen this should be ~ currently it is almost half way down alwaysShow = true -- whether to show anything if there aren't any players spectating you } local spectators = {} addEvent('addSpectator', true) addEvent('removeSpectator', true) addEventHandler('onClientResourceStart', root, function() triggerServerEvent ('addClient', localPlayer) end ) addEventHandler('addSpectator', root, function(spectator) table.insert(spectators, spectator) end ) addEventHandler('removeSpectator', root, function(spectator) for i, val in ipairs(spectators) do if (val == spectator) then table.remove(spectators, i) end end end ) function elementCheck (elem) if elem then if isElement (elem) then if (getElementType (elem) == 'player') then return true end end end return false end function drawSpectators() local textX = x - spectatorSettings.xOffset local textY = spectatorSettings.yOffset if (not isPlayerDead(localPlayer)) then local s_Spectators = 'Spectadores ['.. tostring(#spectators) ..']\n' if (#spectators > 0) then for i, v in ipairs(spectators) do if elementCheck (v) then local name = getPlayerName(v) if (string.len(getPlayerName(v)) > spectatorSettings.charLimit) then name = string.sub(name, 0, spectatorSettings.charLimit)..'..' end if (i > spectatorSettings.count) then s_Spectators = s_Spectators..tostring(#spectators - spectatorSettings.count)..' more' break else s_Spectators = s_Spectators..name..'\n' end else table.remove (spectators, k) end end else if (spectatorSettings.alwaysShow) then s_Spectators = s_Spectators..'None' else s_Spectators = '/' end end dxDrawText (s_Spectators, textX, textY, x, y, tocolor(255, 255, 255, 255), 0.5, 'Bankgothic') dxDrawText (s_Spectators, textX, textY, x, y, tocolor(0, 0, 0, 0), 0.5, 'Bankgothic') --dxDrawText("Spectating [".. tostring(#spectators) .."]", 825, y-410, x, y, tocolor ( 255, 255, 255, 255 ), 0.5, "bankgothic" ) end end addEventHandler('onClientRender', root, drawSpectators) de lado del servidor l GATHER_FREQUENCY = 1000 -- how often in ms it should run the "spectator" function local playerData = {} local spectator_players = {} addEvent('onCameraTargetChange') addEvent('removeClient', true) addEvent('addClient', true) function elementCheck (elem) if elem then if isElement (elem) then if (getElementType (elem) == 'player') then return true end end end return false end function repairTable() for i, val in ipairs (spectator_players) do if not elementCheck (val) then if playerData[val] then if playerData[val].target then if (elementCheck(playerData[val].target) and playerData[val].target ~= val) then triggerClientEvent(playerData[val].target, 'removeSpectator', playerData[val].target, player) end end for k, v in ipairs (playerData) do if (k == val) then table.remove (playerData, k) end end end table.remove (spectator_players, i) end end end function spectators() for i, player in ipairs(spectator_players) do if elementCheck (player) then local target = getCameraTarget(player) if (not playerData[player]) then playerData[player] = {} end if (target ~= playerData[player].target) then -- if the target is different from previous one playerData[player].previous = playerData[player].target -- store the old target playerData[player].target = target -- store the new target triggerEvent('onCameraTargetChange', player, playerData[player].target, playerData[player].previous) end else repairTable() end end end setTimer(spectators, GATHER_FREQUENCY, 0) addEventHandler('onCameraTargetChange', root, function(target, oldTarget) if elementCheck (oldTarget) then -- if the old target is valid(ie. not false or nil(in which case the camera was fixed)) triggerClientEvent(oldTarget, 'removeSpectator', oldTarget, source) -- trigger for the old target to remove from his list end if (target == source) or (not target) then -- if the new target is invalid or facing the player who invoked the event return end if elementCheck (target) then triggerClientEvent(target, 'addSpectator', target, source) -- else we add the player to the targets list end end ) function removeClient() if (playerData[source]) then if (playerData[source].target) then triggerClientEvent(playerData[source].target, 'removeSpectator', playerData[source].target, source) end playerData[source] = nil end for i, val in ipairs(spectator_players) do if (val == source) then table.remove(spectator_players, i) end end end addEvent ('removeClient') addEventHandler ('removeClient', root, removeClient) function addClient() if elementCheck (source) then table.insert(spectator_players, source) end end addEvent ('addClient', true) addEventHandler ('addClient', root, addClient) addEventHandler ('onPlayerQuit', root, removeClient)
  6. hola amigos tengo un scpectator para race dd/dm ps yo tengo semanas intentanto hacer que por ejemmplo le kite lo de #ffffff aun jugador y ponga su color en ello como podria yo hacer eso si pueden ayudarme muchas gracias : D
  7. brad

    Help with bindkey

    pero va con este script addEvent("fxNitro",true) local nitro = {} function FxNitro(veh) if getVehicleController(veh) then local x,y,z = getElementPosition(veh) local rx,ry,rz = getElementRotation(veh) rz = math.rad(rz-180) local dx,dy = math.cos(rz)*1,math.sin(rz)*1 fxAddDebris ( x, y, z, 0 , 0 , 255 , 18 , 2.0 , 2 ) --color1 nitro[veh] = setTimer(FxNitro,50,1,veh) end end addEventHandler("fxNitro",getRootElement(),FxNitro) thx for response
  8. Mta Hello friends I have a problem from time'm trying to resolve this: I have a resource that pressing Alt key activates a smoke but I activ fxGlass or and not what I want off esque turn off when you stop playing the key here the server side script function FxNitro(player) local veh = getPedOccupiedVehicle(player) if veh then triggerClientEvent("fxNitro",player, veh) end end addEventHandler("onPlayerJoin",getRootElement(),function() bindKey(source,"vehicle_fire", "down", FxNitro) end) thax
  9. hi friends recently some friends helped me create a script type and smoke and good and all but something goes wrong, I activate the script (smoke) or click alt normally and remains active: S, then I would know who helps me when I hold the button turn activated the smoke and if I stop button turns off the smoke thanks client addEvent("fxNitro",true) local nitro = {} function FxNitro(veh) if nitro[veh] and isTimer(nitro[veh]) then killTimer(nitro[veh]) end if getVehicleController(veh) then local x,y,z = getElementPosition(veh) local rx,ry,rz = getElementRotation(veh) rz = math.rad(rz-180) local dx,dy = math.cos(rz)*2,math.sin(rz)*2 fxAddTankFire(x,y,z,dx,dy,z) nitro[veh] = setTimer(FxNitro,500,1,veh) nuevamente el efecto end end addEventHandler("fxNitro",getRootElement(),FxNitro) server function FxNitro(jugador) local veh = getPedOccupiedVehicle(jugador) if veh then triggerClientEvent("fxNitro",jugador, veh) que agreguen el efecto. end end addEventHandler("onPlayerJoin",getRootElement(),function() bindKey(source,"vehicle_fire", "down", FxNitro) llamar la función cuando este active el nitro. end)
  10. gothen me sirve el humo y el otro jugador love ,pero ahora lo activo y no se desactiva ya lei todos esas secuencias en la wiki mas o menos las entiendo diego gracias man
  11. ahora el problema eske no se desactiva con la misma tecla y perdone por tanta molestia
  12. no me resulta copie y cambie a mi caso y el otro jugador no v mi nitro
  13. man yo te soy honesto y atodo el mundo yo soy mas noob aki ke un niño de 5 años yo estudio viendo las definiciones de as secuencias nose nada de eso aun
  14. hey ahora un amigo mio no ve el humo kero ke lo vea y perdon por pedir mucho
  15. gracias man te lo agradesdo : D Verga te lo agradesco mucho man
  16. may submit the script done? please'm noob in lua
  17. As you will see mta 1.1 is possible and in 1.0.5 but I want to know how to add this to the car? this is the script setTimer ( function () x, y, z = getElementPosition ( getPedOccupiedVehicle ( getLocalPlayer() ) ) fxAddDebris ( -706, 966, 12.446966171265, 0, 0,255, 255, 2.0, 10 ) end, 50, 0 )
  18. Hello friends I want to know how to make this script aduera the same function of a nitro car and to be the second nitro fx example, I activate the nitro and the smoke is triggered by the car as in this photo
  19. am provare ,pero algo mas yo quiero que funcione al activar el nitro??
  20. am aja e aki es posicion de donde va el efecto y en set timer segundos no? pero para ke valla aderido al auto?
  21. m pero lo ke no entiendo eske como poner los argumentos y si es solo la sintaxis o tengo ke poner el setTimer y otras weas=??
  22. jaja no entendi ni pio diego: S
  23. ola amigos dispuestos a ayudarme kisiera saber como hacer este efecto cuando el nitro se activa en un sv BOSS DERBY 3.7 yase este efecto y yo quisiera saber cual es la secuencia tambien asi podria buscarme las funciones y aprenderlas gracias NOTA:tengo el script pero compilado aki una foto Posdata:no es para sacarlo ni nada estos scripts los alojo en mi server de prueba de scripts nunca los sacare al publico : D almenos que uds digan lo contraria grax buen dia
  24. not much but check and change the arguments and in function drawImage() I try not to use uppercase
×
×
  • Create New...