Jump to content

IIYAMA

Moderators
  • Posts

    5,973
  • Joined

  • Last visited

  • Days Won

    191

Everything posted by IIYAMA

  1. IIYAMA

    String

    aha lol O_o but then there should be an error.
  2. IIYAMA

    String

    if that works, WHAT THE ... DOESN'T WORK!
  3. https://wiki.multitheftauto.com/wiki/FadeCamera https://wiki.multitheftauto.com/wiki/SetCameraMatrix or https://wiki.multitheftauto.com/wiki/SetCameraTarget
  4. function myFunction () end ------------------ ------------------ if a then end ------------------ ------------------ if a then elseif b then end ------------------ ------------------ if a then elseif b then else end ------------------ ------------------ for i=1,2 do end ------------------ ------------------ if a then if b then end end ------------------ ------------------ function myFunction () if a then if b then end end end function myFunction () if a then if b then outputChatBox("b does exist") elseif c then outputChatBox("c does exist") else outputChatBox("b and c does not exist") end else outputChatBox("a does not exist") end end
  5. yes, I wasn't able to find the correct words for it. I only use it for tables or numbers from point to point to reading files. well let we say I using it at every single corner in my code.
  6. ah loop is something that goes through a table and does something with the data. So you can read information very easy and it makes your code a lot smaller. You can write everything there, but you have to put in the the table first. table.insert (myTable,value) --or myTable[#myTable+1] = value Some functions are creating already a table. You can use loops to read the whole table.
  7. This script removes a weapon from a slot, by triggering to server side. client addCommandHander("remove", function () local currentSlot = getPedWeaponSlot (localPlayer) triggerServerEvent("tkWP",localPlayer,currentSlot) end) server addEvent("tkWP",true) addEventHandler ("tkWP",root, function(slot) if isElement(source) then-- check if the player is still in the game takeWeapon ( source, getPedWeapon ( source, slot)) end end)
  8. 1: https://wiki.multitheftauto.com/wiki/Element_tree 2: You can use a loop for differed things. here for index a table: local myTable = {"A","B","C","D"} for i,data in pairs (myTable) do setElementData ( localPlayer, data,1000) end -- or for i=1,#myTable do local data = myTable[i] setElementData ( localPlayer, data,1000) end 3: use relative when you want to use it easy. 4: you don't need to use a "command" argument. It is just how it is written down and the system works. 5:You can export information. 6: Check if something is nil or false if not A then -- check if [u]nil[/u] or [u]false[/u] if A == nil then -- check if [u]nil[/u] if not (A ~= nil) then -- check if [u]nil[/u] -- not recommended if A == false then -- check if [u]false[/u] if not (A ~= false) then -- check if [u]false[/u] -- not recommended 7: ~= = not/unequal 8: Client = your pc Server = the server you are playing on. triggerClientEvent, server sends information to player/players triggerServerEvent, player sends information to server 9: local means that it will stay within the if/function/script/loops T/M end/end of the script sample: if 1 then -- local A = "hey" -- local value A outputChatBox(A) -- shows in the chat "hey" end -- A is gone outputChatBox(A) -- shows "nil" in the chat, because A will only stay between the lines. You use locals to improve the performance of the code, because the data is gone after the execution. If it is outside the functions the data can be used only in the that .lua file.
  9. function makejump(plr) executeCommandHandler("mdestroy", plr) executeCommandHandler("mcreate", plr,1655) executeCommandHandler("rz", plr,-130) end addCommandHandler("mjump", makejump)
  10. It depends what the script request. If the script needs to kick a player or remove a file. Yes then it needs admin rights. If the script gives an error like that, it is missing his rights. resource.NAME
  11. updatd What don't you know?
  12. function makejump(plr) executeCommandHandler("mdestroy", plr) executeCommandHandler("mcreate", plr,1655) executeCommandHandler("rz", plr,-130) end addCommandHandler("mjump", makejump)
  13. IIYAMA

    String

    @#Mr.Pres[T]ege thx updated
  14. IIYAMA

    String

    You may not able to use the same password as the login name. Try this: function autoLogin() local cSerial = getPlayerSerial ( source ) local pass_1 = sha256 (cSerial ) local account = getAccount ( tostring(cSerial),pass_1) if account then logIn ( source, tostring(cSerial),pass_1) outputChatBox("Logged in successfully",source,255,255,255) else local pass_2 = sha256 (cSerial ) addAccount ( tostring(cSerial), pass_2) setTimer(function() if isElement(source) then logIn ( source, tostring(cSerial),pass_2) end end,2000,1) outputChatBox("Registered and logged in successfully",source,255,255,255) end end addEventHandler ( "onPlayerJoin", root, autoLogin )
  15. ah got it, fileSetPos omfg it does not support per line reading...
  16. https://wiki.multitheftauto.com/wiki/FileWrite int fileWrite ( file theFile, string string1 [, string string2, string string3 ...]) How can I write a line at a specific place and later overwrite it with another line of txt?
  17. also could not get it right explain? outputchatbox \/ you had not defined the function in parameter now try function ( source ) outputChatBox ("lol", 255, 255, 255, source, true) You don't have to define a source. (wiki mta) Btw there is always a source when an event got triggered, but it isn't always a player.
  18. dxDrawText(cv,(1205*(sw/1920))+(7*(sw/1920)),(((middle+116)*(sh/1080))+((28*(sh/1080))*(#playersWT-1)))+((28*(sh/1080))*(playersCount-1))+((28*(sh/1080))*(teamsi-1)),1418*(sw/1920),447*(sh/1080),tocolor(255,255,255,255),1.3*(sh/1080),"default","left","top",false,false,false) does not exist. to stop the error you can use: cv or " " But it probably does not solve your problem, because you have to find out why "cv" doesn't exist.
  19. Maybe it is handy to give him link of a table tutorial. http://lua-users.org/wiki/TablesTutorial
  20. updated, >outputChatBoxen(" ",player)
  21. function teleportarPlayer (player, CMD, targetName ) if not targetName then -- check if the player wrote down his target outputChatBox("pls fill in the player name.",player) else local target = getPlayerFromName (targetName ) -- the name is there, now get the player from the name. if not target then -- check if the name is valit outputChatBox("pls fill in the correct player name.",player) else local x,y,z = getElementPosition ( target ) setElementPosition ( player,x,y,z+1) --setElementPosition ( player, getElementPosition ( target )) -- you probably got stuck in him... end end end addCommandHandler ( "goto", teleportarPlayer )
  22. IIYAMA

    invisible :3

    np. good luck with your script.
×
×
  • Create New...