Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Castillo

    xml problem

    Post your XML content.
  2. What exactly is the "protected" attribute? what does it do?
  3. El primer error que veo es que puso: createmarker, "marker" con "M" minuscula.
  4. Mejor usa onClientPreRender.
  5. 1: La verdad que ni idea de que estas hablando, ni siquiera nos decis que sistema usas, grupos ACL talvez? 2: Usa las funciones: getPlayerAccount, getAccountName, aclGetGroup, isObjectInACLGroup, spawnPlayer.
  6. addEvent( "onElementDataInfos", true ) bindKey( "tab", "both", function() if ( guiGetVisible( guiElement1 ) == false ) then guiSetVisible( guiElement1, true ) guiGridListClear(guiElement2) triggerServerEvent( "onElementDataServer", elementPlayer ) addEventHandler( "onElementDataInfos", elementPlayer, function( playerOnline, playerMax, playerPolice, playerBallas, playerAdmins, resourceVersion ) pOnline = playerOnline pMax = playerMax pPolice = playerPolice pBallas = playerBallas pAdmins = playerAdmins rVersion = resourceVersion end ) guiSetText( guiElement3, playerOnline.."/"..playerMax.." Spieler online!" ) guiSetText( guiElement4, #playerPolice.." Polizisten online!" ) guiSetText( guiElement5, #playerBallas.." Ballas online!" ) guiSetText( guiElement6, #playerAdmins.." Admins online!" ) guiSetText( guiElement7, "Resource Version: "..rVersion ) for id, player in ipairs( getElementsByType( "player" ) ) do triggerServerEvent( "onElementDataUpdate", player ) if ( getElementData( player, "listData1" ) > 0 ) then wanteds = getElementData( player, "listData1" ) else wanteds = 0 end local guiElement12 = guiGridListAddRow( guiElement2 ) guiGridListSetItemText( guiElement2, guiElement12, guiElement9, getPlayerName( player ), false, false ) guiGridListSetItemText( guiElement2, guiElement12, guiElement10, getElementData( player, "listData1" ), false, false ) guiGridListSetItemText( guiElement2, guiElement12, guiElement11, getPlayerPing( player ), false, false ) end else guiSetVisible( guiElement1, false ) end end )
  7. addEvent ( "onElementDataServer", true ) addEventHandler ( "onElementDataServer", elementPlayer, function ( ) local playerOnline = getPlayerCount ( ) local playerMax = getMaxPlayers ( ) local players = getElementsByType ( "player" ) local policePlayers = { } local ballasPlayers = { } local adminPlayers = { } for i, v in ipairs( players ) do if ( getDatabase( v, "Fraktion" ) == 1 ) then table.insert ( policePlayers, v ) elseif ( getDatabase( v, "Fraktion" ) == 2 ) then table.insert ( ballasPlayers, v ) end if ( getDatabase( v, "Admin" ) > 0 ) then table.insert ( adminPlayers, v ) end end local resourceVersion = getResourceInfo ( resourceRoot, "version" ) triggerClientEvent ( "onElementDataInfos", source, playerOnline, playerMax, policePlayers, ballasPlayers, adminPlayers, resourceVersion ) end )
  8. function getAdmins ( ) local players = { } for i, v in ipairs ( getElementsByType ( "player" ) ) do if ( getDatabase ( v, "Admin" ) > 0 ) then table.insert ( players, v ) end end return players end To count the players you can do: #getAdmins ( )
  9. I didn't do anything, but well.
  10. So, you edited something and made it public without even knowing the real author?
  11. Castillo

    Problemas

    Proba con esto: function teams ( ) SAS = createTeam ( "SAS", 0, 255, 255 ) Umbrella = createTeam ( "Umbrella", 0, 255, 255 ) end addEventHandler ( "onResourceStart", resourceRoot, teams ) function addthem ( player ) if ( not player ) then return end local accountName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "SAS" ) ) then setPlayerTeam ( player, SAS ) elseif isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Umbrella" ) ) then setPlayerTeam ( player, Umbrella ) end end function addtoteamtimer ( ) setTimer ( addthem, 1000, 1, source ) end addEventHandler ( "onPlayerLogin", root, addtoteamtimer ) addEventHandler ( "onPlayerSpawn", root, addtoteamtimer )
  12. @micheal1230: This should work: local godModeState = false addCommandHandler ( "godmode", function ( ) if ( exports.global:isPlayerSuperAdmin ( localPlayer ) ) then -- You had forgot to define 'localPlayer' and forgot about 'then'. godModeState = ( not godModeState ) outputChatBox ( "God Mode is now ".. ( godModeState and "Enabled" or "Disabled" ) ..".", 0, 255, 0 ) end end ) function togdamage ( attacker, weapon, bodypart ) if ( godModeState ) then cancelEvent ( ) end end addEventHandler ( "onClientPlayerDamage", localPlayer, togdamage )
  13. I don't think it's possible to change the weapon animation.
  14. You're welcome. I'm not sure actually, maybe 2 years. PM me about your database problem.
  15. Why should he use element data? his script is 100% client side and the function: isPlayerSuperAdmin is as well client side.
  16. There's no need to loop if I'm right, there's a function to set a vehicle model handling: setModelHandling
  17. This function is used to load a XML file as a Map file, e.g you have. "Monster" model="557" posX="-676.43225097656" posY="962.98449707031" posZ="12.507791519165" rotX="0.041015625" rotY="0.002777099609375" rotZ="92.063659667969" color="1 1 0 0"/> That should load the XML file as a map and create the vehicle.
  18. Can you guys clarify me who's the real author of this script?
  19. You mean paste a text copied on the clipboard? if so then you can use the function: setClipboard to set the clipboard text.
  20. Lo siento pero eso no tiene el menor sentido. Leete este tutorial: https://wiki.multitheftauto.com/wiki/ES/ ... %B3n_a_Lua
  21. createVehicle Tambien podes crearlos en Map Editor y ponerlos como un mapa.
×
×
  • Create New...