Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Castillo

    spect count

    Quieres decir algo asi: Spectando a: Solidsnake14 -Jugador 1 -Jugador 2 Spectando a: Mario -Jugador 3 -Jugador 5
  2. If you are going to start learning about LUA scripting, then you'll need these functions to create blips & markers. https://wiki.multitheftauto.com/wiki/CreateBlip -- for blips https://wiki.multitheftauto.com/wiki/CreateMarker -- for markers
  3. Castillo

    GUI An

    setTimer can be used in client and server side, if you would take a look in the wiki before asking, it's very understable. https://wiki.multitheftauto.com/wiki/SetTimer Says: Client And Server function.
  4. Which LUA compiler are you using?
  5. Castillo

    GUI An

    What? the one which says client side has to be type="client" in meta.xml, and the one which says server side has to be type="server".
  6. I guess he's talking about a LUA compiler.
  7. Castillo

    spect count

    Ok, arregle el error. 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) En Spectadores pone el numero ahora, pero si no quieres eso lo borras y quitas los "--" de la linea "Spectating [".. tostring(#spectators) .."]"
  8. Castillo

    GUI An

    Firstly, use the LUA tags. Second, guiCreateLabel is client side ONLY, and your event handler is server side, so, you need a event triggered to client. -- server side local vehicle1 =createVehicle ( 520, 302.74, 1818.85, 17.64) ArmyVehicles ={[vehicle1]=true} ArmyTeam = { ["Army"]=true } function ArmyenterVehicle ( player, seat, jacked ) local team = getPlayerTeam(player) if ( ArmyVehicles[source] ) and ( not ArmyTeam[getTeamName ( team )] ) then triggerClientEvent(player,"showErrorLabel",player) cancelEvent() end end addEventHandler ( "onVehicleStartEnter", getRootElement(), ArmyenterVehicle ) -- client side addEvent("showErrorLabel",true) addEventHandler("showErrorLabel",root, function () if errorLabel then destroyElement(errorLabel) end errorLabel = guiCreateLabel( 402, 271, 255, 47, "You aren't an Army Member , you mayn't drive this.", false) end)
  9. function xxx (ammo, killer, killerweapon, bodypart ) if (killer) and (killer ~= source ) then giveWeapon ( killer, 31, 20, true ) outputChatBox(getPlayerName(killer) .." has now a M4, watch out!", getRootElement(), 255, 0, 0) end end addEventHandler ("onPlayerWasted",getRootElement() , xxx)
  10. I don't know how the script works, but I guess you need to configure the mysql details of the script to yours.
  11. Castillo

    spect count

    Eso es porque screenWidht y screenHeight no existen en tu script, tu screenWidht y screenHeight en el script son "x" y "y". dxDrawText("Spectating [".. tostring(#spectators) .."]", 825, y-410, x, y, tocolor ( 255, 255, 255, 255 ), 0.5, "bankgothic" ) Proba con eso.
  12. Castillo

    spect count

    Que queres decir con "No hace nada"? pone /debugscript 3 y dime si pone errores.
  13. I see. Anyway, your outputChatBox is wrong, you need getPlayerName to get the killer's name. outputChatBox(tostring(getPlayerName(killer)) .." Have got M4 For Kill The Noob!!")
  14. Well, I didn't read his main post, I just corrected yours, since you wasn't showing it to all, I leaved it like that. P.S: I know you edited it, but not when I corrected the code.
  15. That would make totally no sense, why would others see what you get? P.S: "You Have got M4" YOU, not "Solidsnake14 has received a M4".
  16. MTA 1.0 and MTA 1.1 maps are compatible, you just copy and paste to the new server. For mysql, you'll need a mysql server, can be xampp (google it), then configure it with your details.
  17. Castillo

    spect count

    Mira, vas a tener que empezar a aprenderte los argumentos de memoria, clickea en el texto en rojo(en dxDrawText), y ahi veras los argumentos.
  18. The problem is already solved. P.S: My IP is not static, is just a private(scripting server), I don't require a static IP.
  19. Get in the server folder and open up mtaserver.conf, there you can change the server name/ports/the scripts(s) that'll start with the server, modules, and many other things.
  20. Got to the MTA folder/server and execute MTA server.exe.
  21. Read the introduction to resources: https://wiki.multitheftauto.com/wiki/Resources
  22. Castillo

    spect count

    dxDrawText("Spectating [".. tostring(#spectators) .."]", argumentos faltantes)
  23. Castillo

    spect count

    Primero, no postes dos veces, usa el boton "EDIT". Segundo, no dijiste como lo querias usar, donde esta el texto donde los contaria?
  24. Firstly, you have to know from which resource they get blown, the only way would be to search every script.
×
×
  • Create New...