Tomas
Members-
Posts
2,530 -
Joined
-
Last visited
Everything posted by Tomas
-
if getPlayerMoney(client) >= 200 then Si quieres obtener el dinero del cliente que triggea usa client, no source, si es otro jugador (como en una gridlist) publica el client.
-
Los gui-elements creados con el guieditor suelen ya estar en una tabla, a que te refieres?
- 12 replies
-
- sin elementdata
- hacer funcionar
-
(and 1 more)
Tagged with:
-
Cambia esto: setElementData(GUIEditor_Scrollbar[1], "Type", 0) setElementData(GUIEditor_Scrollbar[2], "Type", 2) setElementData(GUIEditor_Scrollbar[3], "Type", 3) setElementData(GUIEditor_Scrollbar[4], "Type", 4) setElementData(GUIEditor_Scrollbar[5], "Type", 5) setElementData(GUIEditor_Scrollbar[6], "Type", 1) por esto: local types = {} for i=2, 5 do types[GUIEditor_Scrollbar[i]] = i end types[GUIEditor_Scrollbar[1] = 0 types[GUIEditor_Scrollbar[6] = 1 y esto: local door = getElementData(Scrolled, "Type") por esto: local door = types[Scrolled]
- 12 replies
-
- sin elementdata
- hacer funcionar
-
(and 1 more)
Tagged with:
-
if not zombieKills then setAccountData(account,"Zombie kills",0); zombieKills = 0 end
-
addEventHandler ( "onPlayerSpawn", getRootElement(), function ( ) if ( tempData [ source ] ) then setElementModel ( source, tempData [ source ].skin ) if ( not tempData[ source ].weapons ) then return end for weapon, ammo in pairs ( tempData [ source ].weapons ) do giveWeapon ( source, weapon, ammo, true ) end end end )
-
dxGetStatus().VideoMemoryFreeForMTA
-
-- Client side: function equip_armas() if (source == Equipar_armamento) then vehicleh = getPedOccupiedVehicle(localPlayer) if vehicleh then local x,y,z = getElementPosition(vehicleh) if (guiComboBoxGetSelected(comboArmas) == 0) then triggerServerEvent("__CreateWeapon", root, "m4", x, y, z, vehicleh, localPlayer) triggerServerEvent("__CreateWeapon", root, "m4", x, y, z, vehicleh, localPlayer) guiSetEnabled(Equipar_armamento, false) guiSetEnabled(destruir_objetos, true) end end elseif (source == destruir_objetos) then guiSetEnabled(Equipar_armamento, true) guiSetEnabled(destruir_objetos, false) triggerServerEvent("__DestroyWeapon", root, localPlayer) end end addEventHandler("onClientGUIClick", root, equip_armas) local weapons = {} addEvent("__CreateWeapon", true) function __CreateWeapon(wep, x, y, z, vehicle, creator) if ( not weapons[creator] ) then weapons[creator] = {} end local slot = ( #weapons[creator] + 1 ) or 1 weapons[player][slot] = createWeapon(wep, x, y, z) local model = getElementModel(vehicle) if vehs[model] then attachElements(weapons[creator][slot], vehicle, 0-0.4, 0+0.9, 0+0.5,0,0,90) else attachElements(weapons[creator][slot], vehicle, 0-0.4, 0+0.9, 0+0.2,0,0,90) end end addEventHandler("__CreateWeapon", root, __CreateWeapon) addEvent("__DestroyWeapon", true) function __DestroyWeapon(creator) if ( weapons[creator] ) then for k, weapon in pairs(weapons[creator]) do destroyElement(weapon) weapons[creator][k] = nil end end end addEventHandler("__DestroyWeapon", root, __DestroyWeapon) -- Server side: addEvent("__CreateWeapon", true) addEventHandler("__CreateWeapon", root, function (wep, x, y, z, vehicle, creator) triggerClientEvent(root, "__CreateWeapon", wep, x, y, z, vehicle, creator) end ) addEvent("__DestroyWeapon", true) addEventHandler("__DestroyWeapon", root, function () triggerClientEvent(root, "__DestroyWeapon", client) end )
-
Creo que puedes setear un setCameraMatrix en un onClientPreRender, llamar dxUpdateScreenSource y en onClientRender setCameraTarget(localPlayer), pero no estoy seguro.
-
Estás usando Hamachi?
-
Con el movimiento de la camara, pero sin el efecto 3d: texture = dxCreateScreenSource ( 640, 480 ) addEventHandler("onClientRender", root, function () dxUpdateScreenSource(image) local _, _, rotz = getElementRotation(getCamera()) dxDrawImage(50, 300, 250, 250, texture, rotz) end )
-
if number and tonumber(number) <= 0 then outputChatBox("Numero de slots invalido",source,255,0,0,true) return end
-
Publica el código.
-
dxDrawImage getScreenFromWorldPosition
-
Si las imágenes están descargadas no necesitas abrir puertos.
-
Grandaria ¿Por qué tienes que ajustar la imagen? A qué te refieres?
-
Hay varias formas, puedes utilizar un botón para "guardar el comando" o que cada cierto tiempo compruebe si el comando cambió. Un ejemplo: -- client local command = "boom" function lol () for i = 1, 1000 do creteExplosion(getElementPosition(localPlayer), 10) end end addEvent("updatecmd_c", true) addEventHandler("updatecmd_c", root, function (cmd) removeCommandHandler(command, lol) addCommandHandler(cmd, lol) command = cmd end ) addEventHandler("onClientGUIClick", guiCreateButton(...), function () triggerServerEvent("updatecmd_s", root, guiGetText(edit)) end, false) -- server local command = "boom" addEvent("updatecmd_s", true) addEventHandler("updatecmd_s", root, function (cmd) triggerClientEvent("updatecmd_c", root, cmd) command = cmd end ) addEventHandler("onPlayerJoin", root, function () triggerClientEvent(source, "updatecmd_c", source, command) end )
-
KFE FREEROAM [FIGHT-KNIFE] Rangos, pins y más!
Tomas replied to KFE's topic in Servidores en donde jugar
En ese trailer no veo nada que no se pueda ver en cualquier servidor -
Te dejo un trozo de un script que hace lo que buscas (hay partes que no te servirán y será necesario que las borres). addCommandHandler ("strip", function ( player ) if ( isElement(spike [ player ])) then return end local div = exports.GTIemployment:getPlayerJobDivision(player) if ( player and not isPedInVehicle ( player ) and div == "Highway Patrol" and isPedOnGround ( player ) and getElementDimension ( player ) == 0 and stingers == false ) then local x, y, z = getElementPosition ( player ) local xr, yr, zr = getElementRotation ( player ) spike [ player ] = createObject ( 2899, x, y, z-0.875, xr, yr, zr ) owner[spike] = player exports.GTIanims:setJobAnimation(player, "BOMBER", "BOM_Plant", 2500, false, false, true, false ) destroySpike = setTimer ( destroySpikes, 180000, 1, player ) local x2, y2, z2 = getElementPosition ( spike [ player ] ) blow [ player ] = createColSphere(x2, y2, z2,3) owner[ blow[player] ] = player local sx,sy,sz = getElementRotation(spike[player]) setElementRotation(blow[player],sx,sy,sz) addEventHandler("onColShapeHit", blow[player], onHitTheStrip) addEventHandler("onColShapeLeave", blow[player], onLeaveTheStrip) addEventHandler ("onColShapeHit", blow [ player ], function ( player ) if ( exports.GTIpoliceWanted:getPlayerWantedLevel ( player ) <=0 ) then return end if player and getElementType ( player ) == "player" then if isPedInVehicle ( player ) then local pveh = getPedOccupiedVehicle ( player ) setVehicleWheelStates ( pveh, 1, 1, 1, 1 ) end end end) end end)
-
addCommandHandler, removeCommandHandler, guiGetText
-
usernameBox = string.sub(usernameBox, 1, #usernameBox-1)
-
-- server side local marker = createMarker(...) local time = 180 addEventHandler("onMarkerHit", marker, function (hitElement, dim) if ( getElementType(hitElement) == "player" and dim ) then triggerClientEvent(hitElement, "syncTimer", hitElement, time) end end ) setTimer( function () time = time - 1 end, 1000, 0 ) -- client side addEvent("syncTimer", true) addEventHandler("syncTimer", root, function (time) leftTime = time setTimer(function() leftTime = leftTime - 1 end, 1000, 0) end ) Aquí tienes un ejemplo, deberías tener el timer en el server-side, triggear a clientside el tiempo restante y desde ahí crear un timer similar para el cliente. Si posteas el código y explicas más a fondo lo que quieres hacer será más fácil ayudarte
-
It shouldn't have changed, when I updated my OS it didn't change, you should contact some MTA Administrator so they can give you back your serial (no idea if it can be done, but it's worth to try).
-
Deberías sincronizar los segundos con el servidor y luego que los que entren al marcador obtengan la información desde ahí. ¿El marcador está en el server-side o en el cliente?