Search the Community

Showing results for tags 'bindkey'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
  • Archive
  • Private Bugtracker

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Gang


Location


Occupation


Interests

Found 11 results

  1. Estava fazendo um sistema que em uma parte dele seria preciso utilizar uma bind dentro de um marker para criar um veiculo. Fiz tudo certo, porém, fiz no client-side e acabei sabendo que veículos criados no client-side serviriam apenas para "enfeite", tentei então aprender a como fazer bind no server-side, li na wiki do mta e vi videos relacionados a ela, mas não consegui fazer da maneira correta. Ainda estou confuso com a função bindKey, então se tiver alguém que possa me explicar um pouco dela ou pelo menos me ajudar dizendo o que esta de errado no código, ficarei grato. local g1 = createMarker (1517.796, -694.59, 92.00, "cylinder", 3.0, 184,0,0, 150) function buffalo () bindKey (source, "e", "down", function(thePlayer, player) if isElementWithinMarker(thePlayer, g1) then createVehicle(551, 1517.6644287109,-689.70690917969,94.75) end end) end addEventHandler ("onPlayerLogin", getRootElement(), buffalo)
  2. Estou fazendo um sistema que ao passar pelo marker e apertar "e", spawnaria um veiculo, porem esta spawnando 2 veiculos (quando aperta e quando solta a tecla), mas queria que spawnasse apenas quando apertasse. O código esta assim: local g1 = createMarker (1517.796, -694.59, 92.00, "cylinder", 3.0, 184,0,0, 150) addEventHandler ("onClientMarkerHit", g1, function() addEventHandler ("onClientKey", root, function (button, press) if isElementWithinMarker (localPlayer, g1) then if button == "e" then createVehicle ( 402, 1517.172, -690.4, 94.75, 0, 0, 100) end end end ) end )
  3. Client.lua: function processLockUnlock(vehicle) if vehicle then local vehicleID = tonumber(getElementData(vehicle, "veh:id")) or -1 local vehFaction = tonumber(getElementData(vehicle, "veh:faction")) or 0 local vehOwner = tonumber(getElementData(vehicle, "veh:owner")) or -1 local vehJobID = tonumber(getElementData(vehicle, "veh:jobvehID")) or -1 local locked = isVehicleLocked(vehicle) local vehID = getElementModel(vehicle) local vehName = getVehicleRealName(vehID) if isPedInVehicle(localPlayer) then playSounds("lockin") else playSounds("lockout") end if locked then triggerServerEvent("vehicleLock", localPlayer,localPlayer, vehicle, false) else triggerServerEvent("vehicleLock", localPlayer,localPlayer, vehicle, true) end else outputChatBox("#FFFFFF Nincs kulcsod ehhez a járműhöz.", 169,139,101, true) end end local klikkTimer = false function setVehicleLockState() if klikkTimer then return end if isTimer(klikkTimerRun) then return end klikkTimer = true klikkTimerRun = setTimer(function() klikkTimer = false end,1000,1) local vehicle = getPedOccupiedVehicle ( localPlayer ) if vehicle then processLockUnlock(vehicle) else local int2 = getElementInterior(localPlayer) local dim2 = getElementDimension(localPlayer) local mx,my,mz = getElementPosition(localPlayer) local interior = getElementData(localPlayer, "interior") or false if not interior then for k,v in ipairs(getElementsByType("vehicle")) do local x,y,z = getElementPosition(v) local int = getElementInterior(v) local dim = getElementDimension(v) local dist = getDistanceBetweenPoints3D(x,y,z,mx,my,mz) if dist <= 3 and int2 == int and dim2 == dim then processLockUnlock(v) return end end end end end bindKey("k", "down", setVehicleLockState) setTimer(function() if not bindKey("k", "down", setVehicleLockState) then bindKey("k", "down", setVehicleLockState) end end, 1000, 0) Server.lua: addEvent("vehicleLock",true) addEventHandler("vehicleLock",getRootElement(),function(player,veh,value) setVehicleLocked(veh, value) veh:setData("veh:status", value) end) No errors / warnings in debugscript... if i press the [K] button, nothing happens... what wrong in this code? how to fix?
  4. como eu ativo meu teamsay para as team? por que quando eu entro na team e digito cai no chat say não no teamsay.
  5. Gente como eu privaria isso para 1 grupo só? addCommandHandler("fogo", function(lp) local x,y,z=getElementPosition(lp) local Rocket=createObject(3790,x,y,z-1.5,0,90,0) setTimer(function() moveObject(Rocket,500, x+math.random(0,5), y+math.random(0,5), z+math.random(20,50), 0, 0, math.random(0,200)) triggerClientEvent(root, "startSilvesterRocket", root, x, y, z) setTimer(function() local xr,yr,zr=getElementPosition(Rocket) createExplosion(xr,yr,zr,9,lp) createExplosion(xr,yr,zr,4,lp) destroyElement(Rocket) end,500,1) end,2000,1) end) MaxRocketPack = 3 RocketPack = 0
  6. function rights () outputChatBox("", getRootElement(), 0, 255, 0, false) end addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),rights) function permission (source) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Staff")) or isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Moderator")) then triggerClientEvent(source, "openAdmin", getRootElement()) end end addCommandHandler("mod", permission) function info (player) info = {} local user = getPlayerFromName(player) if not isGuestAccount(getPlayerAccount(user)) then local username = getAccountName(getPlayerAccount(user)) local team = getTeamName(getPlayerTeam(user)) local wanted = getPlayerWantedLevel(user) local ip = getPlayerIP(user) local serial = getPlayerSerial(user) local money = getPlayerMoney(user) local veh = getVehicleName(getPedOccupiedVehicle(user)) triggerClientEvent(source, "sendInformationClient",root,username,team,wanted,ip,serial,money,veh) end end addEvent("sendInfoServer", true) addEventHandler("sendInfoServer", getRootElement(), info) function mute (client) player = getPlayerFromName(client) if isPlayerMuted(player) == false then setPlayerMuted(player, true) outputChatBox(getPlayerName(player).." has been muted by "..getPlayerName(source), getRootElement(), 255, 0, 0, false) elseif isPlayerMuted(player) == true then setPlayerMuted(player, false) outputChatBox(getPlayerName(player).." has been unmuted by "..getPlayerName(source), getRootElement(), 0, 255, 0, false) end end addEvent("mutePlayer", true) addEventHandler("mutePlayer", getRootElement(), mute) function freeze (client) player = getPlayerFromName(client) if isPedFrozen(player) == false then setElementFrozen(player, true) outputChatBox(getPlayerName(player).." has been frozen by "..getPlayerName(source), getRootElement(), 255, 0, 0, false) elseif isPedFrozen(player) == true then setElementFrozen(player, false) outputChatBox(getPlayerName(player).." has been unfrozen by "..getPlayerName(source), getRootElement(), 0, 255, 0, false) end end addEvent("freezePlayer", true) addEventHandler("freezePlayer", getRootElement(), freeze) function warpto (thePlayer) local player = getPlayerFromName(thePlayer) local x,y,z = getElementPosition(player) if isPedInVehicle(source) == true then removePedFromVehicle(source,getPedOccupiedVehicle(source)) setElementPosition(source, x, y+1, z+1) outputChatBox("You have warped to "..getPlayerName(player), source, 0, 255, 0, false) elseif isPedInVehicle(source) == false then setElementPosition(source, x, y+1, z+1) outputChatBox("You have warped to "..getPlayerName(player), source, 0, 255, 0, false) end end addEvent("warptoPlayer", true) addEventHandler("warptoPlayer", getRootElement(), warpto) function warphere (thePlayer) local player = getPlayerFromName(thePlayer) local x,y,z = getElementPosition(source) if isPedInVehicle(player) == true then removePedFromVehicle(player,getPedOccupiedVehicle(player)) setElementPosition(player, x, y+1, z+1) outputChatBox("You have been warped to "..getPlayerName(source), player, 0, 255, 0, false) elseif isPedInVehicle(player) == false then setElementPosition(player, x, y+1, z+1) outputChatBox("You have been warped to "..getPlayerName(source), player, 0, 255, 0, false) end end addEvent("warpPlayerhere", true) addEventHandler("warpPlayerhere", getRootElement(), warphere) function killgay (gay) setElementHealth(getPlayerFromName(gay),0) end addEvent("kill:O", true) addEventHandler("kill:O", getRootElement(), killgay) function wantedlvl (client, amount) player = getPlayerFromName(client) setPlayerWantedLevel(player, amount) outputChatBox(getPlayerName(player).."'s wanted level has been changed to "..amount.." by "..getPlayerName(source), getRootElement(), 255, 0, 0, false) end addEvent("setPlayerwanted", true) addEventHandler("setPlayerwanted", getRootElement(), wantedlvl) function kickgay (client, respon, reason) player = getPlayerFromName(client) kickPlayer(player, respon, reason) outputChatBox(getPlayerName(player).." has been kicked by "..getPlayerName(respon), getRootElement()) end addEvent("kickPlayeraway", true) addEventHandler("kickPlayeraway", getRootElement(), kickgay) function setskin (client, ID) player = getPlayerFromName(client) setElementModel(player, ID) outputChatBox("Your skin has been changed to "..ID.." by "..getPlayerName(source), player, 255, 255, 0, false) end addEvent("setPlayerskin", true) addEventHandler("setPlayerskin", getRootElement(), setskin) function setHP (client, amount) player = getPlayerFromName(client) setElementHealth(player, amount) outputChatBox("Your health has been changed to "..amount.." by "..getPlayerName(source), player, 0, 255, 255, false) end addEvent("setPlayerhealth", true) addEventHandler("setPlayerhealth", getRootElement(), setHP) function setArmor (client, amount) player = getPlayerFromName(client) setPedArmor(player, amount) outputChatBox("Your armor has been changed to "..amount.." by "..getPlayerName(source), player, 0, 255, 255, false) end addEvent("setPlayerarmor", true) addEventHandler("setPlayerarmor", getRootElement(), setArmor) function announce (text) outputChatBox("*ADMIN* "..text, getRootElement(), 255, 0, 0, false) end addEvent("adminAnnounce", true) addEventHandler("adminAnnounce", getRootElement(), announce) function destroycar (client) player = getPlayerFromName(client) car = getPedOccupiedVehicle(player) if isPedInVehicle(player) then destroyElement(car) outputChatBox("Your car has been destroyed by "..getPlayerName(source), player, 255, 0, 0, false) outputChatBox("You have destroyed "..getPlayerName(player).."'s car", source, 255, 0, 0, false) else outputChatBox(getPlayerName(player).." isn't in a vehicle", source, 255, 0, 0, false) end end addEvent("destroyveh", true) addEventHandler("destroyveh", getRootElement(), destroycar) function fixcar (client) player = getPlayerFromName(client) car = getPedOccupiedVehicle(player) if isPedInVehicle(player) then fixVehicle(car) outputChatBox("Your car has been fixed by "..getPlayerName(source), player, 255, 0, 0, false) outputChatBox("You have fixed "..getPlayerName(player).."'s car", source, 255, 0, 0, false) else outputChatBox(getPlayerName(player).." isn't in a vehicle", source, 255, 0, 0, false) end end addEvent("fixveh", true) addEventHandler("fixveh", getRootElement(), fixcar) hello good before all this script is mine only to edit it to make it panel moderator l have a problem that only to open the panel is addCommandHandler and I have done many BindKey functions and then I would like someone to help me make the bindKey and be able to Positioning to the "Server.Lua" what I just put there is all the Server.Lua and want to position the bindkey somewhere but that is on the Server.Lua Help Please I do.
  7. I have been trying to bindkeys to a command clientside and save them inside a xml file. But the mta binding cache is stacking up. Keys: 'x', 'u', 'x' See screenshot bellow. The problem shows up when you edit the bindkey in the settings menu and load the xml file after saving it. To use the bindkeys, you have to bind it with any key on your keyboard. To know which bindkeys are bound to a command with your previous visit, you have to bind any key of your keyboard to that command in order to use: getBoundKeys / getKeyBoundToCommand If you use unbindKey, it will unbind the command for all other keys, but not remove it from the cache. And another problem, I can't remove keys/'alternative keys' from the cache unless I click on the 'Load defaults button on the right bottom'. This is the code I have been testing with:
  8. Greetings, i am making a new script to chatBox, but i have some problem making a script to binds with my new chatBox. The user when want make the bind (example: /bind 4 drawLineInScreen colorR colorG colorB) i take the string drawLineInScreen, but when i want make te bind using bindKey, there are 2 options. option 1 bool bindKey ( player thePlayer, string key, string keyState, function handlerFunction, [ var arguments, ... ] ) option 2 bool bindKey ( player thePlayer, string key, string keyState, string commandName, [ string arguments ] ) In option 1 i can add 1 or more arguments, in option 2 i can add 1 only argument. The data than i have is the commandName, I need the function to my commandName and i can use very arguments with the option 1. PLS HELP ME.
  9. Mojko

    bindKey (server)

    Hey I need some help, regarding "bindKey" so what I basicly want to do is check if the player is pressing down a button, and when he does, I want to return a boolean value. function keyInput(player, key, keyState) if(keyState == "down") then end outputChatBox("Pressing: " .. key) end function bindKeysWhenPlayerJoin() bindKey(source, "lalt", "down", keyInput) end addEventHandler("onPlayerJoin", getRootElement(), bindKeysWhenPlayerJoin) So basicly I have the basics down, when the player joins the server the keys will bind, and when I press "lalt" then it gets printed out to the player's chat box. The issue here is though, that I can't use this, for like anything, since I cannot return a value that I can later use. Let me give an example. Psuedo code: I want to check if - The player is colliding with a static pickup - The player is pressing lalt then print a message Code: function playerPickupCollision(pickup, dimension) -- Jobs for i = 1, #pickupInformation do if(pickup == pickupInformation[i][PICKUP_ID]) then outputChatBox(i, source) if(pickupInformation[i][TYPE] == "Job" && pressing_key("lalt")) then outputChatBox("Press LALT to become a " .. pickupInformation[i][DESCRIPTION], source) end if(pickupInformation[i][TYPE] == "Property" && pressing_key("lalt")) then outputChatBox("This is the " .. pickupInformation[i][DESCRIPTION], source) end end end end addEventHandler("onPlayerPickupHit", getRootElement(), playerPickupCollision) (pressing_key isn't an actual function. it's the kind of function I want to create) Thank you!
  10. análisis de la función () Ventana = guiCreateWindow (207, 164, 442, 357, "Panel De Mods Beta | Servidor", false) guiWindowSetSizable (Ventana, falsa) guiSetVisible (Ventana, falsa) ShowCursor (falso) armaon = guiCreateButton (9, 69, 39, 19, "On", falsa, ventana) guiSetProperty (armaon, "NormalTextColour", "FFAAAAAA") armaoff = guiCreateButton (58, 69, 39, 19, "Off", falsa, Ventana) guiSetProperty (armaoff, "NormalTextColour", "FFAAAAAA") labe = guiCreateLabel (31, 44, 43, 15, "Armas:", falsa, ventana) guiSetFont (Labe, "default-negrita-pequeño") AUTOON = guiCreateButton (127, 69, 39, 19, "On", falsa, ventana) guiSetProperty (AUTOON, "NormalTextColour", "FFAAAAAA") autoof = guiCreateButton (176, 69, 39, 19, "Off", falsa, ventana) guiSetProperty (autoof, "NormalTextColour", "FFAAAAAA") de la nariz = guiCreateLabel (141, 44, 64, 15, "Vehiculos:", falsa, ventana) guiSetFont (nariz, "default-negrita-pequeño") Mucho = guiCreateLabel (274, 44, 34, 15, "Skins:", falsa, ventana) guiSetFont (mucho, "default-negrita-pequeño") skinon = guiCreateButton (245, 69, 39, 19, "On", falsa, ventana) guiSetProperty (skinon "NormalTextColour", "FFAAAAAA") skinoff = guiCreateButton (294, 69, 39, 19, "Off", falsa, ventana) guiSetProperty (skinoff, "NormalTextColour", "FFAAAAAA") Hudon = guiCreateButton (344, 69, 39 19, "On", falsa, ventana) guiSetProperty (Hudon, "NormalTextColour", "FFAAAAAA") hudoff = guiCreateButton (393, 69, 38, 19, "Off", falsa, ventana) guiSetProperty (hudoff, "NormalTextColour" "FFAAAAAA") HUD = guiCreateLabel (373, 44, 23, 15, "Hud", falsa, ventana) busque = guiCreateLabel (8, 126, 266, 15, "* Bienvenidos al Servidor .", falsa, ventana) guiSetFont (Bien, "default-negrita-pequeño") guiLabelSetColor (BIEN, 37, 142, 249) masss = guiCreateLabel (8, 201, 423, 15, "* Estós hijo Los Siguientes Mods Que PUEDES Desactivar para Ganar mas fps.", falso, ventana) guiSetFont (masss, "default-negrita-pequeño") guiLabelSetColor (masss, 37, 142, 249) Raios = guiCreateLabel (8, 176, 346, 15, "* Para Desactivar ALGÚN mod Debes apretar haga clic en Off / On "., falsa, ventana) guiSetFont (Raios," por defecto-bold-pequeño ") guiLabelSetColor (Raios, 37, 142, 249) raioss = guiCreateLabel (8, 151, 423, 15," * Selecciona Los mods Que quieras Desactivar Y viceversa, ganas mas fps ", falsa, ventana). guiSetFont (raioss," default-negrita-pequeño ") guiLabelSetColor (raioss, 37, 142, 249) REE = guiCreateLabel (8, 226, 423, 15," - Vehiculos (Pronto Mejora un uno Desactivar uno por) ", falsa, ventana) guiSetFont (ree," default-negrita-pequeño ") guiLabelSetColor (REE, 37, 142, 249) reeb = guiCreateLabel (8, 251, 302, 15," - Pieles (. Pronto Mejora Para Desactivar Uno por Uno) ", falsa, ventana) guiSetFont (Reeb," default-negrita-pequeño ") guiLabelSetColor (Reeb, 37, 142, 249) ifo = guiCreateLabel (8, 276, 37, 15, "-. Hud", falsa, ventana) guiSetFont (ifo, "default-negrita pequeña") guiLabelSetColor (ifo, 37, 142, 249) iforr = guiCreateLabel (8, 301, 54, 15, "- Armas. ", falsa, ventana) guiSetFont (iforr," ") default-negrita-pequeña guiLabelSetColor (iforr, 37, 142, 249) ncluso = guiCreateLabel (8, 326, 423, 15," * es Una versión beta 1.0, insecto CUALQUIER Contactarse con Algún personal. ", falsa, ventana) guiSetFont (ven," default-negrita-pequeño ") guiLabelSetColor (ven, 37, 142, 249) final AddEventHandler (" onClientResourceStart ", getRootElement (), el panel) la función de abrir () si guiGetVisible (ventana) == true entonces guiSetVisible (Ventana, falsa) ShowCursor (falso) lo demás guiSetVisible (Ventana, true) ShowCursor (verdadero) extremo final bindKey ( "F2", "abajo", para abrir) - Funciones ------
  11. Una pregunta un poca tonta, pero en fin. Mi problema es éste: function key() setElementPosition(theObject, x+1,y,z) end for i,v in ipairs(getElementsByType("player")) do bindKey(v,"w","down",key) end El objeto se mueve hacia adelante, pero solo una vez, o sea, preciono 'w' una vez y se mueve, pero si preciono la tecla de nuevo no pasa nada, no sé si es porque estoy haciendo un for para sacar al jugador, pero si pongo ' source ' me da error.