Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. yeah, thats what i meant, but for me doesn't work and others too.
  2. hey, i've recently uploaded my script editor in-game but i got a big problem, i can't paste code in the GUI memo, anyone know how to solve this? Thanks in advance.
  3. Castillo

    Kill System

    try this, is not tested. function onWasted(killer) if getElementType(killer) == "player" then outputChatBox(getPlayerName(killer).. " killed ".. getPlayerName(source) .."!",getRootElement(),255,0,0) end end addEventHandler("onPlayerWasted",getRootElement(),onWasted)
  4. Hi community, i know that there is already a in-game script editor but since i started when there wasn't any i continued the developement of it and i finished the first version, i would like to tell you what includes. Features: Open script (meta.xml also) Save script (if the script doesn't exist it will create one) Reload script Script browser (doesn't includes the meta.xml, you can open it via gui edit) Goto line system (thanks to the mta forums for giving me most of code for it) Script is restricted to admin group, you can change it on first lines at server side part When select text it will be marked as red 2.0 Create resource added! command to use it: /editor download link: https://community.multitheftauto.com/index.php?p=resources&s=details&id=1354
  5. varez made an online compiler, here is the link to it: http://mta.dzek.eu/compiler/
  6. lol? then getAccountData to get them
  7. hmm, i think offering a server is not really worth (its my opinion) maybe if you could tell us what exactly you need will help much, i think.
  8. Castillo

    Win trouble

    first script is client side? if yes then its totally wrong because account data is only server side.
  9. Castillo

    goto line

    it seems to work, but now about selecting the text, how i can do this? is possible?
  10. Castillo

    goto line

    i get an error: attempt to perform arithmetic on local 'targetLine' (a nil value) code: function explode(div,str) if (div=='') then return false end local pos,arr = 0,{} for st,sp in function() return string.find(str,div,pos,true) end do table.insert(arr,string.sub(str,pos,st-1)) pos = sp + 1 end table.insert(arr,string.sub(str,pos)) return arr end local mystring = guiGetText(script_memo) local exp = explode("\n", mystring) local targetLine = tonumber ( guiGetText ( script_memo ) ) local index=0 for i=1, targetLine-1 do index = index + exp[i]:len() end function getLineIndex(mystring, targetLine) local exp = explode("\n", mystring) local index=0 for i=1, targetLine-1 do index = index + exp[i]:len() end return index end Edit: i set targetLine to 3 and no errors, i do goto line 1 and it moves to start of script, but my problem is: how i can do something to select the line?
  11. you don't have the resource started or the resource "scoreboard" doesn't exist.
  12. you can use account data functions, but you must make it server side since account data is only server side, here are the links to them. to save: https://wiki.multitheftauto.com/wiki/SetAccountData to load: https://wiki.multitheftauto.com/wiki/GetAccountData event handlers: to save: https://wiki.multitheftauto.com/wiki/OnPlayerQuit to load: https://wiki.multitheftauto.com/wiki/OnPlayerLogin
  13. it tells the script errors.
  14. debug script is not a resource Lol, you type in-game /debugscript 3 when you are logged in as admin and there you are.
  15. you got errors, do you know how to use debugscript? if not then type /debugscript 3 in-game (loged in as admin) client side: localPlayer = getLocalPlayer() function addColumns() exports.scoreboard:scoreboardAddColumn("Points") exports.scoreboard:scoreboardAddColumn("Deaths") setElementData(localPlayer,"Points",0) setElementData(localPlayer,"Deaths",0) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), addColumns) function get() local playerMoney = getPlayerMoney(source) local playerPoints = getElementData(getLocalPlayer(), "Points") local playerWasted = getElementData(getLocalPlayer(), "Deaths") end server side: addEvent("onPlayerDestructionDerbyWin",true) addEventHandler("onPlayerDestructionDerbyWin",getRootElement(), function (winner) outputChatBox(getPlayerName ( winner ) .. " Win and give 3 Points",getRootElement(),0,255,0) setElementData(winner,"Points",tonumber(getElementData(winner,"Points"))+3) end) addEventHandler("onPlayerWasted",getRootElement(), function () setElementData(source,"Deaths",tonumber(getElementData(source,"Deaths"))+1) end)
  16. you mean the column isn't being created?
  17. yes, also "ocal player" must be "local player", remplace onPlayerWashted with onPlayerWasted and ocalPlayer with localPlayer
  18. first errors i see: at first of client side script says "ocal player" not "local player" and in server side you're calling wrong the onPlayerWasted event, look addEventHandler("onPlayerWashted",getRootElement(), you're doing "onPlayerWashted" they aren't the same.
  19. i hate RP real life not RPG, i have my own custom RPG mode but not like SANL or SAES, it has many things unrealistic (which is what i love) since its a game.
  20. Castillo

    ElementHealth

    yes but next time make it yourself or at least try
  21. Castillo

    goto line

    i don't get how to implement your code varez in my script. btw it gives an error at this line: index = index + exp.len attempt to perform arithmetic on field 'len' (a function value) edit: fixed error, index = index + exp:len() edit2: i've tryed to implement it, question: do i have to add: local mystring = guiGetText(script_memo) local exp = explode("\n", mystring) local targetLine = tonumber ( guiGetText ( script_memo ) ) local index=0 for i=1, targetLine-1 do index = index + exp[i]:len() end guiMemoSetCaretIndex(script_memo,index) in the event when click "goto line" button? or let it external?
  22. we don't know how is your code, you can make it via commands.
  23. is not old Zango i use them in my game mode
×
×
  • Create New...