Jump to content

brad

Members
  • Posts

    96
  • Joined

  • Last visited

Everything posted by brad

  1. sorry man i am more noob wahit you
  2. Hello friends and good morning to the great scripters of this forum, Quisiro know how to put my spectator so that when a player sees another player to play you can see what other players are watching thx to my script below spectators_c.lua --[[ * Multi Theft Auto - Spectators * spectators_c.lua * Original file by Zango --]] 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:\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..'Nadien' else s_Spectators = '/' end end dxDrawText (s_Spectators, textX, textY, x, y, tocolor(0, 205, 205, 205), 1.3, 'banghotic') end end addEventHandler('onClientRender', root, drawSpectators) spectators_s.lua --[[ * Multi Theft Auto - Spectators * spectators_s.lua * Original file by Zango --]] local 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) thx -- s:D -->
  3. I'm reading the wiki but mta sa fucniones alone and understood the syntax and arguments: D
  4. I'm reading the wiki but mta sa fucniones alone and understood the syntax and arguments: D
  5. ok JR10 good day thank you very much : D
  6. but I say not to go compile several compiling one by one
  7. Compile several scripts one example see: I have a gamemode about 10 scripts and I want to compile the scripts and nose 10 talves a program that allows me to select 10 scripts and compile them all those 10 scipts
  8. Hello friends I want to know how to compile multiple scripts at once and you ise a great gamemode and how to modify them because the programmer from RunCode SAMT2497 told to me to modify a script puee RunCode compiled or something thanks!
  9. hola amigos quisiera saber cmo hacer un script de efecto de nitro como en el server derby boss es para uso personal no lo sacare a la luz es un humo de color a eleccion que sale del auto cuando tieenes nitro gracias : D
  10. brad

    EMpezando en lua !

    gracias amigos pues me toca leer un poko la wiki yo conosco a samt2497 y pues esper oque el me empuje paso pequeños
  11. brad

    guiCreateFont Help

    with the bracket I served, one could create the script to your Estylo to compare?
  12. brad

    guiCreateFont Help

    gracias jr10 , but is good the script and meta?
  13. Hello friends scripters: D I'm trying to prove up new server but I am ami ffuente noob and not very well how to hold the goal or the script that shows this is the wiki local myLabel = guiCreateLabel( 120, 200, 120, 100, "GUI label", false ) -- Use 'toggle' command to switch custom font on and off addCommandHandler( "toggle", function() if not myFont then myFont = guiCreateFont( "ferrari.ttf", 20 ) -- Create GUI custom font guiSetFont( myLabel, myFont ) -- Apply font to a widget else destroyElement( myFont ) -- Destroy custom font myFont = nil end end and the meta.xml "brad" description="cinema" info="mod" type="script"/> thanks :D
  14. quisiera saber como hacer este script ess una imagen del boss basemode que se mueve al inicio y pues lo quisiera poner en mi race_client para cuando un mapa cargue NOTA:soy muy noob en lua
  15. si es mi punto , y muy util
  16. example I had to load 32 s to png and is a work meta.xml do that my point is to load those 32 png example in a wave line
  17. I called attention to this and think it's possible but you have to see, I have a resource that read 32 frames png and wow a lot of work, or at least to me put it in the goal, as you can make the goal to read all ? as in some script that a sequence says, "imagename" .. index ... "png") and then read them all and what to the EMTA r could do something similar can you?
  18. muchas gracias amigos mios
  19. Hola amigos de mta soy brad efron un juego en boss derby race y ase un año que intento aprender lua en mi pais no enseñan ni se ve eso la wiki es como muy avanzada para mi solo e entendido algunas cosillas lo que se aser y e aprendido solo es:crear un comando,mensajes en chat,script de wter,cielo,remplazos,dff,txd,logos pero todo es editado ,osea no lo ago yo la mayoria se editar scripts etc... quisiera se me empujan para aprender lua ,gracias
  20. ok aki brad en algunos servers e notado que los autod tienen una hadling (manipulacion) diferente nose si es un xml,lua o la manipulacion por default del dff ayuda alguien? Gracias!!!
  21. brad

    ayuda

    muchas gracias amigos ,pero tengo una ultima duda y perdon por molestar como ago para modificar la velocidad d reproduccion? gracias!!
  22. sorry but now my question is the time I change the time of Media?
  23. thank you very much you helped me be your slave could finally Have a nice day greetings and thank you very much for your help thanks enverdad
×
×
  • Create New...