Jump to content

Noname20

Members
  • Posts

    5
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Noname20's Achievements

Vic

Vic (3/54)

1

Reputation

  1. I want to set the name with the command but I forgot to place the addCommandHandler
  2. Thanks! And what about this? This only place a number 0 or 1 to the database not the name. Why? function setAdminNick(thePlayer, commandName, targetPlayer, name) if getElementData(thePlayer, "fejlesztoBejelentkezve", true) then if not (targetPlayer) then outputChatBox("#F74B4B[Rendszer] #FFFFFF: Helyes használat : / " .. commandName .. " [Név / ID] [Admin név]", thePlayer, 255, 255, 255, true) else local targetPlayer, targetPlayerName = exports.Adminsystem:findPlayer(thePlayer, targetPlayer) local queryHandler = dbQuery(con, 'SELECT * FROM accounts') local result = dbPoll(queryHandler, 500) local ID = getElementData(thePlayer, "acc:id") for num, row in pairs(result) do if (row.id == ID) then local adminname = setElementData(targetPlayer, "adminnick", name) dbExec(con, "UPDATE accounts SET adminnick=?", adminname) outputChatBox("#F74B4B[Rendszer] #FFFFFF: Sikeresen beállítottad: #F74B4B" .. targetPlayerName:gsub("_"," ") .. " #FFFFFFadminisztrátori nevét : #F74B4B" ..getElementData(targetPlayer, "adminnick").. "#FFFFFF.", thePlayer, 255, 255, 255, true) end end end end end
  3. Hi! I'm writeing a dashboard and it should write the admin lvl and the admin name, the admin name is working great, but when I get the data from the mysql database and I set it to an element data it's only gives a boolean value. SERVER SIDE: addEvent("adatokLekerdezese", true) addEventHandler("adatokLekerdezese", resourceRoot, function(serial) local queryHandler = dbQuery(con, 'SELECT * FROM accounts') local result = dbPoll(queryHandler, 500) local serial = getPlayerSerial(client) if (result) then if (#result > 0) then if (result[1]['serial'] == serial) then local adminSzint = setElementData(client, "admimlvl", tostring(result[1]['adminlvl'])) else end end end end ) CLIENT SIDE: local adminSzint = tostring(getElementData(localPlayer, "adminlvl"))
  4. Szerintem használd inkább a smoothMoveCamerat itt a mozgás is benne lesz mikor lefut és szebben is néz ki Kliens oldalra be kell ezt illeszteni: local sm = {} sm.moov = 0 sm.object1,sm.object2 = nil,nil local function removeCamHandler() if(sm.moov == 1)then sm.moov = 0 end end local function camRender() if (sm.moov == 1) then local x1,y1,z1 = getElementPosition(sm.object1) local x2,y2,z2 = getElementPosition(sm.object2) setCameraMatrix(x1,y1,z1,x2,y2,z2) end end addEventHandler("onClientPreRender",root,camRender) function smoothMoveCamera(x1,y1,z1,x1t,y1t,z1t,x2,y2,z2,x2t,y2t,z2t,time) if(sm.moov == 1)then return false end sm.object1 = createObject(1337,x1,y1,z1) sm.object2 = createObject(1337,x1t,y1t,z1t) setElementAlpha(sm.object1,0) setElementAlpha(sm.object2,0) setObjectScale(sm.object1,0.01) setObjectScale(sm.object2,0.01) moveObject(sm.object1,time,x2,y2,z2,0,0,0,"InOutQuad") moveObject(sm.object2,time,x2t,y2t,z2t,0,0,0,"InOutQuad") sm.moov = 1 setTimer(removeCamHandler,time,1) setTimer(destroyElement,time,1,sm.object1) setTimer(destroyElement,time,1,sm.object2) return true end Használat + példa: smoothMoveCamera ( float x1, float y1, float z1, float x1t, float y1t, float z1t, float x2, float y2, float z2, float x2t, float y2t, float z2t, int time ) smoothMoveCamera (-1527.97180, -259.88281, 14.34688, -1555.83667, -203.45720, 19.37344, -1661.17383, -168.68188, 19.37344, -1632.46838, -138.43019, 19.37344, 8000) Leállítás: function kameraMozgasLeallitas() removeEventHandler("onClientPreRender",root,camRender) end Funkción belül csak simán meghívod ezt a kameramozgasleallitas funkciót és le is állt és vissza ugrott a játékosra
  5. Hi! I'm makeing a hud what can save the datas when the player is quit and load it when a player connect. I made the MYSQL part it can save and it can load but I dont know how to send the loaded datas to the client side to make itt appear in a dxdraw. This is the Server sided part addEvent("adatokBetoltese", true) addEventHandler("adatokBetoltese", resourceRoot, function(username, health, food, armor, drink, money) local queryHandler = dbQuery(con, 'SELECT * FROM characters') local result = dbPoll(queryHandler, 500) --outputChatBox("Lefut") if (result) then --outputChatBox("Itt is") if (#result > 0) then --outputChatBox("Itt szintén") local username = getPlayerName(client) if (result[1]["username"] == username) then local pH = setElementHealth(client, result[1]["health"]) local pF = tonumber(setElementData(client, "karakter:ehseg", result[1]["food"])) local pA = setPedArmor(client, result[1]["armor"]) local pW = tonumber(setElementData(client, "karakter:szomjusag", result[1]["drink"])) local pM = tonumber(setPlayerMoney(client, result[1]["money"])) outputChatBox("1. " ..result[1]["username"]) outputChatBox("2. " ..result[1]["health"]) outputChatBox("3. " ..result[1]["food"]) outputChatBox("4. " ..result[1]["armor"]) outputChatBox("5. " ..result[1]["drink"]) outputChatBox("6. " ..result[1]["money"]) triggerClientEvent("adatLekerdezes", client, pA, pF, pA, pW, pM) --outputChatBox("Egyezik!") --outputChatBox("Mysql username: " ..result[1]["username"]) end end end end ) And this is the client side part. It gives a true or false but idk how to make it a number local pA = triggerServerEvent("adatokBetoltese", localPlayer, pA) local pF = tonumber(triggerServerEvent("adatokBetoltese", localPlayer, pF)) or 0 local pW = tonumber(triggerServerEvent("adatokBetoltese", localPlayer, pW)) or 0 local pM = tonumber(triggerServerEvent("adatokBetoltese", localPlayer, pM)) or 0
×
×
  • Create New...