Jump to content

Enargy,

Members
  • Posts

    1,102
  • Joined

Everything posted by Enargy,

  1. try this timer = {} addEventHandler("onClientPlayerWeaponFire", localPlayer, function(weapon) if weapon == 16 then setElementData(localPlayer, "anti repeater", true); if ( getElementData(localPlayer, "anti repeater") == true ) then toggleControl("fire", false); timer[source] = setTimer( function() toggleControl("fire", true); setElementData(localPlayer, "anti repeater", false); removeEventHandler("onClientPlayerWeaponSwitch", getRootElement(), cancelShots); end, 5000, 1 ) addEventHandler("onClientPlayerWeaponSwitch", getRootElement(), cancelShots); end end end) function cancelShots() if ( getPedWeapon(localPlayer) == 16 ) then toggleControl("fire", false); else toggleControl("fire", true); end end
  2. Si no posteas el código como crees que podemos ayudarte ?
  3. client addEvent("kolorely", true); function dajkolor(a, b, c) setVehicleColor(getPedOccupiedVehicle(localPlayer), a,b,c); outputChatBox(a..","..b..","..c); end addEventHandler("kolorely", getRootElement(), dajkolor) server function nadajkolory(_, kontod) if kontod then r = setAccountData(kontod, "kolor", 56); g = setAccountData(kontod, "kolor2", 24); b = setAccountData(kontod, "kolor3", 67); a = getAccountData(kontod, "kolor"); b = getAccountData(kontod, "kolor2"); c = getAccountData(kontod, "kolor3"); if ( tonumber(a) and tonumber(b) and tonumber(c) ) then triggerClientEvent(source, "kolorely", resourceRoot, a,b,c); end end end addEventHandler("onPlayerLogin", getRootElement(), nadajkolory)
  4. function batdaudoiten(editdoiten,theplayer) ketnoidatabase = dbConnect("mysql","dbname=db;host=localhost","root","","share=0") Vcoins = dbExec(ketnoidatabase,"SELECT*FROM accounts WHERE Vcoins") if (Vcoins>=100) then local price = Vcoins - 100 layVcoins = dbExec(ketnoidatabase,"UPDATE ?? SET ?? = ?",accounts,Vcoins,price) setname = dbExec(ketnoidatabase, "UPDATE ?? SET ?? = ?", characters, charactername,editdoiten) if layVcoins and setname then outputChatBox("b?n dã d?i tên thành công") end else outputChatBox("có l?i x?y ra trong quá trình d?i tên, hãy báo l?i v?i admin Hy",theplayer) end else outputChatBox("b?n không d? Vcoins d? d?i tên! hãy ra forums n?p Vcoins nhé",theplayer) end addHanler("submitdoiten",true) addEventHandler("submitdoiten",root,batdaudoiten)
  5. Puedes usar isObjectInACLGroup triggerClientEvent playSound3D addCommandHandler
  6. function batdaudoiten(editdoiten,theplayer) ketnoidatabase = dbConnect("mysql","dbname=db;host=localhost","root","","share=0") Vcoins = dbExec(ketnoidatabase,"SELECT*FROM accounts WHERE Vcoins") if (Vcoins>=100) then local price = Vcoins - 100 layVcoins = dbExec(ketnoidatabase,"UPDATE ?? SET ?? = ?",accounts,Vcoins,price) setname = dbExec(ketnoidatabase, "UPDATE ?? SET ?? = ?", characters, charactername,editdoiten) if (layVcoins,setname) then outputChatBox("b?n dã d?i tên thành công") end else outputChatBox("có l?i x?y ra trong quá trình d?i tên, hãy báo l?i v?i admin Hy",theplayer) end else outputChatBox("b?n không d? Vcoins d? d?i tên! hãy ra forums n?p Vcoins nhé",theplayer) end addHanler("submitdoiten",true) addEventHandler("submitdoiten",root,batdaudoiten)
  7. Nunca enviaste el valor 'dinero' al client. function imprimir(player, cmd, dinero) if not dinero then return end if ( type(dinero) == "number" ) then triggerClientEvent(player, "modificarmasa", player, dinero); outputChatBox("Se han imprimido $" .. dinero.. " pesos"); end end addCommandHandler("imprimir", imprimir)
  8. you could use createObject attachElements
  9. La idea era que el lo supiera hacer . y de ahí viene el tiro.
  10. function Mensaje() puto = outputChatBox puto("Lol") puto("xD") puto("Wtf") puto(":P") puto(":D") end addEventHandler ("onResourceStart", getRootElement(), Mensaje) Espero Mas Retos Casa Vez Me Van Subiendo El Level No. te dije que lo hicieras sin usar 5 veces el outputChatBox. es decir: function hola() outputChatBox("hola") -- debes hacer que el output se repita 5 veces sin multiplicarlo como lo hiciste . end No hacer esto porfavor: outputChatBox("hola") outputChatBox("hola") outputChatBox("hola") outputChatBox("hola") outputChatBox("hola")
  11. puto = outputChatBox puto("sos puto") puto("sos puto") puto("sos puto") puto("sos puto") puto("sos puto") Me cagaste @Juanes_Lopez el reto sigue.
  12. remove addCommandHandler and use: bindKey("lshift", "down", flyCar)
  13. SERVER: cst = false function fly(player) if isPlayerInTeam(player, "Staff") then if (cst == false) then cst = true triggerClientEvent(player,"onFly", player) outputChatBox("Flying Cars is now Enabled", player, 255, 255, 255, true) else cst = false triggerClientEvent(player,"offFly", player) outputChatBox("Flying Cars is now Disabled", player, 255, 255, 255, true) end end end addCommandHandler("fly", fly) function isPlayerInTeam(player, team) assert(isElement(player) and getElementType(player) == "player", "Bad argument 1 @ isPlayerInTeam [player expected, got " .. tostring(player) .. "]") assert((not team) or type(team) == "string" or (isElement(team) and getElementType(team) == "team"), "Bad argument 2 @ isPlayerInTeam [nil/string/team expected, got " .. tostring(team) .. "]") return getPlayerTeam(player) == (type(team) == "string" and getTeamFromName(team) or (type(team) == "userdata" and team or (getPlayerTeam(player) or true))) end CLIENT: addEvent("onFly", true) addEvent("offFly", true) function flyON() setWorldSpecialPropertyEnabled("aircars", true) end function flyOFF() setWorldSpecialPropertyEnabled("aircars", false) end addEventHandler("onFly", getRootElement(), flyON) addEventHandler("onFly", getRootElement(), flyOFF)
  14. Puedes comenzar haciendo 5 outputs en el chat pero sin agregar 5 veces outputChatBox
  15. idk if i get you but are you looking for this? local functionEnabled = false function vehicleEntry() if ( functionEnabled =~ false ) then outputChatBox("I picket a car!", source) -- or triggerEvent or whatever you want. return true; end return false; end addEventHandler ("onPlayerVehicleEnter", root, vehicleEntry) addCommandHandler("enablefunction", function(player,cmd) -- it gonna activate that function who is disabled. functionEnabled = not functionEnabled; end)
  16. Yo estoy aprendiendo aun LUA por Aqui! es muy funcional y comprensible. PD: no quiero tu host.
  17. if ( loginX and type(loginX) == "number" ) and ( loginY and type(loginY) == "number" ) and ( loginZ and type(loginZ) == "number" ) then spawnPlayer(playerFromName,loginX,loginY,loginZ); setElementFrozen(source,false); else return false; end not tested
  18. Nothing Unless Lies BRO
  19. Podrias usar setElementDimension para cambiar la dimensión de los jugadores y en ella restringir el funcionamiento de otros resources. nunca he trabajado en un MGM pero mi opinión es esta.
  20. addEventHandler("onPlayerCommand", getRootElement(), function(cmd) if (cmd == "login") then cancelEvent() end end) :
  21. It should be client, not server: -- CLIENT function ReplaceSkin() local gang = exports["CSTgang"]:getPlayerGang(getLocalPlayer()); if (gang and gang == "The_Street_Fighters") then txd = engineLoadTXD ( "wmyclot.txd" ); engineImportTXD ( txd, 217); dff = engineLoadDFF ( "wmyclot.dff", 217); engineReplaceModel ( dff, 217); end end addEventHandler("onClientResourceStart", resourceRoot, ReplaceSkin)
  22. Nunca esperes a que alguien venga y te dé un código porque casi nunca puede pasar. es mejor aprender LUA que en lugar de que otros lo hagan por ti.
  23. That's impossible. only you may try with this method: addEventHandler("onClientPreRender", root, function() local boolean = true; if isElementInWater( getLocalPlayer() ) then toggleControl("sprint", not boolean); else toggleControl("sprint", boolean); end end)
×
×
  • Create New...