Jump to content

Tekken

Helpers
  • Posts

    1,423
  • Joined

  • Last visited

  • Days Won

    19

Everything posted by Tekken

  1. Replace givePlayerMoney(killer, source) with givePlayerMoney(killer, (getPlayerMoney(source) or 0)); As you need to get the killed player money before you can give it to the killer. Good luck.
  2. Thanks I will keep that in mind.
  3. When I said onClientGUIClick I was talking about GUI, I know DGS won’t work I have read the wiki
  4. Ok got it thank you. I actually use a slightly different way but the same principal however that didn’t work with DGS so I try’d like this and I got this warning. Thank you both. I use « onClientGUIClick », resourceRoot, etc and check the source within the function however didn’t updated my gui don’t know why So I should attach it within the create function I’ m I right ?
  5. Hi, I'm trying to implement DGS over my GUI scripts and I came to a strange warning, client.lua: 3: Bad argument @ ''addEventHandler" [Expected element at argument 2, got nil] witch is strange that the element exists and the script works just fine while using GUI however this is a simple example of what my script does, actually I'm trying to update a gridlist while typing something into an edit box. local shop = {window = {},edit={}}; addEventHandler("onClientResourceStart", resourceRoot, function() shop.window[1] = dgs:dgsCreateWindow((sW-483)/2, (sH-352)/2, 483, 352, "some window", false, 0xff000000, 25, nil, 0xC800ff00, nil, 0x96141414, 5, false); shop.edit[1] = dgs:dgsCreateEdit(419, 81, 40, 27, "1", false, shop.window[1]); end); addEventHandler("onDgsTextChange", shop.edit[1], function() -- do something... end); Greetings
  6. There is an error within your mysql resource as instead of a table it returns boolean otherwise said 'false' that means the resource could not connect or check for whatever you may check in the database, so you should check the function select in resource mysql. good luck! SQL it's not exactly my thing, so I can only tell you there is a problem there, as also I only worked with SQLite witch it's the same thing basically but SQLite it's offline.
  7. There is no 187 line in the code you posted, but I assume there is a problem with your MySQL database.
  8. In core_client.Lua (survivorSystem_client.Lua) you may find the event onClientPlayerDamage and there you will see what happens when in water as if you add another that may create conflicts within the scripts. Also remplace getPedSkin with getElementModel as getPedSkin it's no longer a supported function.
  9. After some play out with createLight these are the results https://imgur.com/a/bOqpVFb And I am pretty satisfied. Once more thank you IIYAMA
  10. Ok, so you have a suggestion?
  11. Tried it out, it doesn't change anything. That may be exactly what I need. Thank you.
  12. So can someone help me with a shader for a little bit more light for peds as some time they're basically black like shadows, so I will really appreciate if someone can show me how to make a shader as I don't understand how those work at all. Thank you guys.
  13. triggerServerEvent triggerClientEvent or using setElementData getElementData good luck
  14. Well in playSound you just need to put kalkils.mp3 or either add the entire path to the meta file depending on the file location within the resource
  15. What do you mean move the tabel? As far as I can see with your arrows you're just trying to change the positions in the table between the elements 1 and 2 (you may call them subtables as they're in the same table), am I right?
  16. I assume you are using dayz gamemode so you will find an event in the client side that manages the blod loss so all you hace to do is to put this at the very top of the event just after cancelEvent() If getElementModel(source) == 285 then return; end if getElementModel(source) == 285 then return; end
  17. This is not how it should line 8 replace this setElementData(player, "lvl", table[i], (getElementData(player,"lvl", table[i]) or 0) + 1); with this setElementData(player, table[i], (getElementData(player, table[i]) or 0) + 1); As I have showed you in the post before, and as I said if you don't understand you may use the more rudimentary way for the beginning and upgrade it as you learn more, as I have did when I have started learning. Good luck.
  18. The first one, for sure. Also you may see on the wiki page of triggerClientEvent Note: It is marginally more efficient to pass one large event than two smallers ones. Btw triggerClientEvent ("name", elm) you don't need to specify the first root as it's already by default. Hope this helped you.
  19. So in accounts.Lua you should have an event called onPlayerDayZLogin addEventHandler("onPlayerDayZLogin", root, function() local lvl = getElementData(source, "lvl") or 0; if lvl then if lvl > 1 then -- give him something elseif lvl > 2 then -- give him something elseif lvl > 3 then -- give him something elseif lvl > 4 then -- give him something elseif lvl > 5 then -- give him something end end end); And for onPlayerLevelUp addEventHandler("onPlayerLevelUp", root, function(newlvl) if newlvl then if newlvl > 1 then -- give him something elseif newlvl > 2 then -- give him something elseif newlvl > 3 then -- give him something elseif newlvl > 4 then -- give him something elseif newlvl > 5 then -- give him something end end end); This is pretty rudimentary as I highly recommend u using something like this but you may not understand table = {"Milk","GPS","Map","Milk","Milk","Milk","Milk","Milk","Milk","Milk","Milk","Milk","Milk","Milk","Milk"} --15 items for 15 levels (you got it?) addEventHandler("EVENT-NAME-HERE", root, function(lvl) -- You may add the event you want here if not lvl then lvl = getElementData(source, "lvl") or 0; end if lvl >= 1 then for i = 1, lvl do setElementData(source, table[i], getElementData(source, table[i]) + 1); end end end); good luck
  20. That's pretty simple as you may just add a if oldlvl + 1 > 30 then return end within addPlayerXp function. And for rewards using the event onPlayerLevelUp you add statement like if newlvl >= 1 then give him something. And for items at spawn you sould check his lvl on spawn and give the item depending on his level Sorry I'm on the phone so I can't do better
  21. You misspelled the 'kilLDayZPlayer' event as you can see it's kilL and not kill (don't know why) local xpNeed = 100; -- E.g. 100 * lvl = XP you need to rank up! addEvent("onPlayerLevelUp", true); function addPlayerXp(player, xp) local acc = getPlayerAccount(player); local oldexp = getAccountData(acc, "exp") or 0; local oldlvl = getAccountData(acc, "lvl") or 1; local newlevel = oldlvl + 1; local newexp = oldexp + xp; setAccountData(acc, "exp", newexp); setElementData(player, "exp", newexp); if (newexp >= (oldlvl * xpNeed)) then local expleft = newexp - (oldlvl * xpNeed); -- added calculation for the exp that may remains after level up. outputChatBox("[Level-Up] Congratulations! New level "..newlevel.."!", player, 66, 134, 244); setAccountData(acc, "lvl", newlevel); setAccountData(acc, "exp", expleft); setElementData(player, "exp", expleft); setElementData(player, "lvl", newlevel); triggerEvent("onPlayerLevelUp", player, newlevel, oldlvl, oldexp, newexp); end end addEventHandler("onPlayerLogin", root, function() local acc = getPlayerAccount(source); if acc then setElementData(source, "lvl", getAccountData(acc, "lvl") or 0); setElementData(source, "exp", getAccountData(acc, "exp") or 0); end end); addEventHandler("onZombieGetsKilled", root, function(killer) if killer and getElementType(killer) == "player" then addPlayerXp(killer, 50); end end); addEventHandler("kilLDayZPlayer", root, function(killer) if (killer and killer ~= source and getElementType(killer) == "player") then addPlayerXp(killer, 50); end end); You're welcome
  22. Try this one: local xpNeed = 100; -- E.g. 100 * lvl = XP you need to rank up! addEvent("onPlayerLevelUp", true); function addPlayerXp(player, xp) outputChatBox("3")-- test do not delete local acc = getPlayerAccount(player); local oldexp = getAccountData(acc, "exp") or 0; local oldlvl = getAccountData(acc, "lvl") or 1; local newlevel = oldlvl + 1; local newexp = oldexp + xp; setAccountData(acc, "exp", newexp); setElementData(player, "exp", newexp); if (newexp >= (oldlvl * xpNeed)) then local expleft = newexp - (oldlvl * xpNeed); -- added calculation for the exp that may remains after level up. outputChatBox("[Level-Up] Congratulations! New level "..newlevel.."!", player, 66, 134, 244); setAccountData(acc, "lvl", newlevel); setAccountData(acc, "exp", expleft); setElementData(player, "exp", expleft); setElementData(player, "lvl", newlevel); triggerEvent("onPlayerLevelUp", player, newlevel, oldlvl, oldexp, newexp); end end addEventHandler("onPlayerLogin", root, function() local acc = getPlayerAccount(source); if acc then setElementData(source, "lvl", getAccountData(acc, "lvl") or 0); setElementData(source, "exp", getAccountData(acc, "exp") or 0); end end); addEventHandler("onZombieGetsKilled", root, function(killer) if killer and getElementType(killer) == "player" then addPlayerXp(killer, 50); end end); addEventHandler("killDayZPlayer", root, function(killer) outputChatBox("1") -- test do not delete if (killer and killer ~= source and getElementType(killer) == "player") then outputChatBox("2")-- test do not delete addPlayerXp(killer, 50); end end); and make another video
  23. You tried my way and it didn't work? Also may I see the errors in /debugscript 3 ?
×
×
  • Create New...