Jump to content

NeXuS™

Retired Staff
  • Posts

    1,134
  • Joined

  • Last visited

  • Days Won

    37

Everything posted by NeXuS™

  1. function presidentArrived() local skin = getElementModel(source) if (skin == 21) then outputChatBox("The President has arrived!", getRootElement(), 0, 120, 80, false) end end addEventHandler("onPlayerSpawn", getRootElement(), presidentArrived) The "getPedSkin" function is deprecated.
  2. NeXuS™

    Complie

    Can you give us your code atleast?
  3. Do you mean you want that the text shows the ID too?
  4. @LopSided_, this post is already fixed btw. You can see my posts above.
  5. Yeah, that's all you'll have to do. If you need further help with that one too, feel free to ask.
  6. outputChatBox ("Teleportáltál: "..getPlayerName(jatekos)..".", admin, 255, 0, 0, true) outputChatBox ("Teleportált hozzád: "..getPlayerName(admin)..".", jatekos, 255, 0, 0, true)
  7. Which line are you getting the error for?
  8. If it is respawned, the element data is still saved. The problem starts if your car got destroyed. You'll have to save the cars in a database, else how do you know which car needs a customname?
  9. There was an error in the client-side script. An end was missing. addEventHandler("onClientRender", getRootElement(), function() local pX, pY, pZ = getElementPosition(localPlayer) for i, k in ipairs(getElementsByType("vehicle")) do if getElementData(k, "customName") then local cX, cY, cZ = getElementPosition(k) if getDistanceBetweenPoints3D(cX, cY, cZ, pX, pY, pZ) <= 20 then if isLineOfSightClear(cX, cY, cZ+1, pX, pY, pZ+1) then local cX, cY = getScreenFromWorldPosition(cX, cY, cZ+1) if cX and cY then dxDrawText(getElementData(k, "customName"), cX, cY) end end end end end end)
  10. Gonna give it a go in 10 mins. Can you wait a bit please?
  11. Add this line to it. setCameraTarget(source)
  12. function spawn_player_on_join() spawnPlayer (source, 0, 0, 0) fadeCamera(source, true) end addEventHandler ("onPlayerJoin", spawn_player_on_join)
  13. It's about indexing the table. You just set the table's value at the index of "192.168.56.1" to true. You can call that value by just indexing the table (tableName[indexName]). As you have true at that index, it will be like "if true then", so it goes into the true part, and outputs the "correct text". But, if you can't index the table, so it doesn't have somone elses IP registered in the table, it'll always return false, so it'll be like "if false then", so it goes into the false part. I hope you can understand it. It was just indexing a table with the corrected code, but at the original code you were comparing a table with a string value, and two different type of variables can't be equal.
  14. function adminauth() local ips = { ["192.168.56.1"] = true } local p_IP = tostring(getPlayerIP(source)) if ips[p_IP] then setElementData (source, "administrator", true) outputChatBox ("correct! #FFFFFF"..p_IP.."", getRootElement(), 0, 255, 0, true) else outputChatBox ("wrong! #FFFFFF"..p_IP.."", getRootElement(), 255, 0, 0, true) end end addEventHandler ("onPlayerJoin", getRootElement(), adminauth)
  15. NeXuS™

    God mode

    function nodamage(attacker) if isElement(attacker) and getElementType(attacker) == "player" and attacker ~= localPlayer then cancelEvent() end end
  16. NeXuS™

    God mode

    function nodamage(attacker) if isElement(attacker) and getElementType(attacker) == "player" then cancelEvent() end end
  17. NeXuS™

    God mode

    Put your "nodamage" function's code here.
  18. function dropTHIS(res) if res == getThisResource() then local rTable = posTable[math.random(#posTable)] local fX, fY, fZ = unpack(rTable[1]) local sX, sY, sZ = unpack(rTable[2]) local area = getZoneName(fX, fY, fZ) local city = getZoneName(sX, sY, sZ, true) outputChatBox(area.." >< "..city,root) end end addEventHandler("onResourceStart",root,dropTHIS)
  19. NeXuS™

    Serials

    -- Registration here function registerPlayer(username,password,passwordConfirm) if (getAccountCount(source) >= 2) then return end if not (username == "") then if not (password == "") then if not (passwordConfirm == "") then if password == passwordConfirm then local account = getAccount (username,password) if (account == false) then local accountAdded = addAccount(tostring(username),tostring(password)) if (accountAdded) then triggerClientEvent(source,"hideRegisterWindow",getRootElement()) outputChatBox ("#0000FF* #FFFFFFYou have sucessfuly registered! [Username: #ABCDEF" .. username .. " #FF0000| #FFFFFFPassword: #ABCDEF" .. password .. "#FFFFFF]",source,255,255,255,true ) logOut(source) logIn(source, accountAdded, password) logOut(source) setTimer(outputChatBox,800,1,"#0000FF* #FFFFFFYou can now login with your new account.",source,255,255,255,true ) else outputChatBox ("#0000FF* #FFFFFFAn unknown error has occured! Please choose a different username/password and try again.",source,255,255,255,true ) end else outputChatBox ("#0000FF* #FFFFFFError! An account with this username already exists!",source,255,255,255,true ) end else outputChatBox ("#0000FF* #FFFFFFError! Passwords do not match!",source,255,255,255,true) end else outputChatBox ("#0000FF* #FFFFFFError! Please confirm your password!",source,255,255,255,true) end else outputChatBox ("#0000FF* #FFFFFFError! Please enter a password!",source,255,255,255,true) end else outputChatBox ("#0000FF* #FFFFFFError! Please enter a username you would like to register with!",source,255,255,255,true) end end function getAccountCount(player) local serial = getPlayerSerial(player) local accounts = getAccountsBySerial(serial) if(accounts) and (type(accounts == "table")) then return #accounts end return false end This one should work without any problems. Your code above has a problem in it, which we were discussing above.
  20. What is not working with it tho? Any error?
  21. NeXuS™

    Serials

    @ccw, or you could this. executeSQLQuery("UPDATE accounts SET serial=?, ip=? WHERE name=?", getPlayerSerial(source), getPlayerIP(source), username) But I think your method is easier for begginer scripters.
  22. NeXuS™

    Serials

    Again, won't work. Check my comment above bud. Your IP and serial gets set into the database when you LOG IN. So if you just have a register, but no login, you can register as many accounts as you want.
  23. NeXuS™

    Serials

    This one won't work either, because of IP and serial are set during login.
  24. NeXuS™

    Serials

    I dont think you understood whats the issue with your code. And I dont understand a word from what you just said.
  25. NeXuS™

    Serials

    The main problem with this is if you register your account, but don't LOG IN, your serial wont be saved into the database, and you can register as many accounts as you want.
×
×
  • Create New...