-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
[TUT] Protect Client Script at the Highest Level
Castillo replied to laserlaser's topic in Tutorials
What exactly is the "protected" attribute? what does it do? -
El primer error que veo es que puso: createmarker, "marker" con "M" minuscula.
-
Mejor usa onClientPreRender.
-
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.
-
You're welcome.
-
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 )
-
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 )
-
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 ( )
-
I didn't do anything, but well.
-
So, you edited something and made it public without even knowing the real author?
-
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 )
-
@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 )
-
I don't think it's possible to change the weapon animation.
-
You're welcome. I'm not sure actually, maybe 2 years. PM me about your database problem.
-
Why should he use element data? his script is 100% client side and the function: isPlayerSuperAdmin is as well client side.
-
There's no need to loop if I'm right, there's a function to set a vehicle model handling: setModelHandling
-
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.
-
Can you guys clarify me who's the real author of this script?
-
You mean paste a text copied on the clipboard? if so then you can use the function: setClipboard to set the clipboard text.
-
Si, con esas funciones podes hacerlo.
-
Lo siento pero eso no tiene el menor sentido. Leete este tutorial: https://wiki.multitheftauto.com/wiki/ES/ ... %B3n_a_Lua
-
createVehicle Tambien podes crearlos en Map Editor y ponerlos como un mapa.