Jump to content

Enargy,

Members
  • Posts

    1,102
  • Joined

Everything posted by Enargy,

  1. Hey guys!, I would like to know how to add an image to the scoreboard by setElementData and getElementData. or something else. Regards.
  2. Also you can use 'isElementWithinMarker'
  3. Enargy,

    Need help

    each weapon has a specific id in order to be identified, what you want to create a new type of weapon with id 31 it is impossible.
  4. the god_mode or rather on eventHandler 'onClientPlayerDamage' works for any damage that may receive a player (explosive melee damage and lack of oxygen).
  5. I might need to do this but in XML file?
  6. it doesn't work. creating the file shows the following error: WARNING: [server]\log\server.lua:127: fileOpen: unable to load file WARNING: [server]\log\server.lua:129: Bad usage @ 'fileRead' [bad number of bytes] the file is created with the first text but to repeat the procedure as it is not added the new text.
  7. @Ciber you're right in the act of creating the file but your code doesn't work not even the text is written to the file
  8. Hello, my mistake is that when I run the command by typing a text file created in the plogs.txt but if i write again this replaces the old text. I want to know is how do to add new text without deleting the old one. server.lua function createLogs(thePlayer, command, text) local time = getRealTime() dia = time.hour mes = time.month anio = time.year local fileHandle = fileCreate(":"..getResourceName(getThisResource()).."/txt/plogs.txt") if fileHandle then fileWrite(fileHandle, "* ["..dia.."/"..mes.."/"..anio.."] nickname = '"..getPlayerName(thePlayer).."' text = '"..text.."' \n") fileClose(fileHandle) end end addCommandHandler("addtext", createLogs) Regards.
  9. Enargy,

    Disable carmods

    try this (i have not tried) addEventHandler("onClientResourceStart", resourceRoot, function() for i, v in ipairs(getElementsByType("vehicle")) do local vehicleID = getVehicleIDFromName ( v ) engineRestoreModel ( vehicleID ) end end
  10. Enargy,

    Disable carmods

    check it out https://wiki.multitheftauto.com/wiki/EngineRestoreModel
  11. Enargy,

    Parachute

    post the code parachute.lua
  12. Enargy,

    Mutiple skins

    I think he refers to warping 4 peds in a car in this case... try with this server.lua warpPedIntoVehicle createVehicle createPed
  13. Syntax bool engineReplaceModel ( dff theModel, int modelID [, bool alphaTransparency = false ] ) #9. line engineReplaceModel(dff, 5708)
  14. did you use Weapon Flags on the third setWeaponProperty value?
  15. something, but now you have to add the trigger on client-side with the function of a specific button.
  16. use server-side addEvent addEventHandler client-side onClientGUIClick triggerServerEvent
  17. Post the server-side code
  18. hello, I have this simple announce script but I have an error when text is sent, the text is too long for the Label. is there any way to use the simbol "\n" for the label ? client-side timer = 8000 addEventHandler("onClientResourceStart",resourceRoot, function() ad = guiCreateLabel(189, 10, 643, 109,"", false) guiSetFont(ad,"sa-header") guiSetVisible(ad, false) end) addEvent("show.gui",true) addEventHandler("show.gui",getRootElement(), function() showGUI() end) function showGUI() window = guiCreateWindow(263, 196, 401, 144,"write your text bellow",false) guiWindowSetSizable(window, false) edit = guiCreateEdit(11, 48, 376, 36,"",false,window) ok = guiCreateButton(233, 99, 95, 35,"OK",false,window) close = guiCreateButton(90, 99, 95, 35,"Close",false,window) showCursor(guiGetVisible(window)) end addEventHandler("onClientGUIClick",root, function() if (source == ok) then local text = guiGetText(edit) triggerServerEvent("show.text",localPlayer,text) end end) addEvent ("set.text", true) addEventHandler ("set.text", getRootElement(), function (text) guiSetText(ad,text) guiSetVisible(ad,true) setTimer( guiSetVisible,timer,1,ad, false) end) addEventHandler("onClientGUIClick",root, function () if (source == close) then guiSetVisible(window,false) showCursor(guiGetVisible(window)) end end) Regards.
  19. are you using superman resource from community?
  20. can you explain me with more details, please?
  21. 'isPlayerInACLGroup' is not defined. if it is for server side use isObjectInACLGroup
  22. Enargy,

    Restart timer

    function restartCommand(source, command) if (isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(source)),aclGetGroup("Admin"))) then outputChatBox("00FF00[server]FF0000 Restart 10min kuluttua!",getRootElement(),255,0,255,true) setTimer ( step2, 300000, 1) else outputChatBox("You don't have permission to restart server!",source,255,0,0) return end end addCommandHandler("Restartti", restartCommand) function step2() outputChatBox("00FF00[server]FF0000 Restart 5min kuluttua!",getRootElement(),255,0,255,true) setTimer ( step3, 240000, 1) end function step3() outputChatBox("00FF00[server]FF0000 Restart 1min kuluttua!",getRootElement(),255,0,255,true) setTimer ( step4, 30000, 1) end function step4() outputChatBox("00FF00[server]FF0000 Restart 30sec kuluttua!",getRootElement(),255,0,255,true) setTimer ( step5, 20000, 1) end function step5() outputChatBox("00FF00[server]FF0000 Restart 10sec kuluttua!",getRootElement(),255,0,255,true) setTimer ( step6, 5000, 1) end function step6() outputChatBox("00FF00[server]FF0000 Restart 5sec kuluttua!",getRootElement(),255,0,255,true) setTimer ( step7, 5000, 1) end function step7() outputChatBox("00FF00[server]FF0000 Restart NYT!",getRootElement(),255,0,255,true) shutdown (reason or "Restart") end
  23. fixed.. function consoleAddUpgrade ( thePlayer, commandName, id ) if ( isPlayerInVehicle ( thePlayer ) ) then local id = tonumber ( id ) if not tonumber (id) then return end local theVehicle = getPedOccupiedVehicle ( thePlayer ) local success = addVehicleUpgrade ( theVehicle, id ) if ( success ) then outputConsole ( getVehicleUpgradeSlotName ( id ) .. " modificacion anadida.", thePlayer ) else outputConsole ( "((Fallo al tunear)).", thePlayer ) end else outputConsole ( "((Tienes que estar en un vehiculo!))", thePlayer ) end end -- add the function as a handler for the "addupgrade" command addCommandHandler ( "tunear", consoleAddUpgrade )
×
×
  • Create New...