thund3rbird23

Members
  • Content Count

    91
  • Joined

  • Last visited

Everything posted by thund3rbird23

  1. I want to use THIS resource because it's place shaders to all vehicle (non-UV vehicles too) it's working but how can I position the stickers? like I want to place on doors or roof or hood? And how can I place multiple stickers at the same time ex: roof & doors
  2. That's a gui not dx and just a dropdown can't use arrows (up,down,right,left) and doesn't have submenu
  3. I understand now. Thank you so much for the help and for the explanation!
  4. Yes, this is way more cleaner, thanks. But I don't understand clearly, sorry. So what I need to do with the table? For example I want to set the deagle stat 999 how will the table look? id 1, stat 71 owner 1 and where do I put the skill value (999) ? or I dont interpret well?
  5. Where can I find a simple vertical dropdown menu? Or just a tutorial how to do it? I really did research before opened the topic but almost find nothing about dx menus.. all of them are guis not dx or just the find mouse cursor position thing. Or what's the easiest way for a beginner to create a simple back colored (50% opacity) dx menu but I want to use arrows instead of mouse click... I mean up,down,right,left arrows for moving up, down, expand, close the menus and if I click to the for ex.: menu1 then expand the menu1 submenu and if I click to the submenu in the menu1 then output submenu1 in the chatbox (just for testing) I hope you guys understand what I want to do. But HERE is an example
  6. Thanks, now works. But I got another problem. I want to seperate each skills so I did rows for all skills ak47,m4,pistol etc.... and I want to set all stat when the character is loaded but it's only set the ak stat. Now the code look this: local owner = charID dbQuery(function(qh) local poll = dbPoll(qh,0) for _,v in ipairs(poll) do local ak47 = v["ak47"] local m4 = v["m4"] local pistol = v["pistol"] local silencedpistol = v["silencedpistol"] local deagle = v["deagle"] local shotgun = v["shotgun"] local sawnoff = v["sawnoff"] local spas = v["spas"] local mp5 = v["mp5"] local sniper = v["sniper"] setPedStat(player, 77, ak47) setPedStat(player, 78, m4) setPedStat(player, 69, pistol) setPedStat(player, 70, silencedpistol) setPedStat(player, 71, deagle) setPedStat(player, 72, shotgun) setPedStat(player, 73, sawnoff) setPedStat(player, 74, spas) setPedStat(player, 76, mp5) setPedStat(player, 79, sniper) end end, {},connection,"SELECT * FROM weaponstats WHERE owner=?",owner)
  7. https://wiki.multitheftauto.com/wiki/SetPedStat bool setPedStat ( ped thePed, int stat, float value ) value: the new value of the stat. It must be between 0 and 1000. So set the value to 77... I want to get the value from mysql database. It's have a weaponstats table which contains id,owner,ak47 column. And the ak47 table value is 999 and I do query the ak47 row value "local ak47 = v["ak47"]" that's why I did put the ak47 instead of 999.
  8. dbQuery(function(qh) local poll = dbPoll(qh,0) for _,v in ipairs(poll) do local ak47 = v["ak47"] end owner = 1 end,{},connection,"SELECT * FROM weaponstats WHERE owner=?",owner) setPedStat(player, 77, ak47) Bad argument @ 'setPedStat' [Expected number at argument 3, got nil]
  9. Nothing changed with that extra line I think. But thanks @IIYAMA
  10. I will try, thanks! What do you mean? The rotation thing?
  11. I see! I will do more debugs in the future. I already seen your debugging tutorial. And what do you think about my last question? Can fix it somehow?
  12. Okay, I did it with the same code which I attach it to the hand. Now works perfect. But one more thing.... The weapon is moving lumpy (?) it almost jumps out of my hand when I rotate. Watch it in the video: https://www.youtube.com/watch?v=35gfJkEXoj4 Can I fix this? Or I can't do nothing with this?
  13. But the armaobject is in the loop?! --- debugs --- k returns false arma returns 1 {"DEFAULTAK", 30, 1254} 2 {"GOLDAK", 30, 2965} wep returns false(2x) previousWeaponID returns nil armaobject returns false currentWeaponID returns nil --- debugs --- I'm not sure you wanted these debuglines or in this way but I hope you can understand something It isn't be easier if I attach the weapon to the back like I attach to the hand?
  14. Did you mean this? I changed and still don't attach the weapon on my back it's in my hand: function removeDefaultAK(source) for k,arma in ipairs(weapons) do local wep = getElementData(source,arma[1]) local x,y,z = getElementPosition(source) if previousWeaponID == arma[2] then --wep not hand armaobject = createObject(arma[3],x,y,z) -- object created attachElementToBone(armaobject,source,3,0.19,-0.31,-0.1,0,270,-90)-- here back coords obj attached end if currentWeaponID == arma[2] then --wep hand end end if isElement(armaobject) then destroyElement(armaobject) -- destroyed object end end
  15. No, I'm just did test by myself. But this code doesn't even work locally I mean I can't see the weapons on my back.
  16. Thanks for your suggestions. I added if isElement(armaObject) then ... and get no errors, but the code does nothing or I doing something wrong. Because the weapon still attached in my hand. I'm using an inventory system and triggering a server side event called "removeDefaultAK" if the player tuck in or putting away their weapon (I don't know which is the right word in English, sorry.) So now the code looks like this: weapons = { {"DEFAULTAK",30,1254},--wep,id,object {"GOLDAK",30,2965}, } function removeDefaultAK(source) for k,arma in ipairs(weapons) do local wep = getElementData(source,arma[1]) local x,y,z = getElementPosition(source) if previousWeaponID == arma[2] then --wep not hand armaobject = createObject(arma[3],x,y,z) -- object created attachElementToBone(armaobject,source,3,0.19,-0.31,-0.1,0,270,-90)-- here back coords obj attached end if currentWeaponID == arma[2] then --wep hand if isElement(armaobject) then destroyElement(armaobject) -- destroyed object end end end end addEvent("removealapAK", true) addEventHandler("removealapAK", getRootElement(), removeDefaultAK) By the way, if I want to use your suggestion instead of the ipairs then I need to set player's currentweapon_1 elementdata to true or to the weapon name in the table ex.: AK-47 when he take out their weapon if I'm right?!
  17. Thanks, but the destroyElement don't work. Bad argument @ 'destroyElement' [Expected element at argument 1, got nil]
  18. One more thing, I changed the models to: function obtenerObjeto(arma) local defaultak = getElementData(localPlayer, "defaultak") local goldak = getElementData(localPlayer, "goldak") local m if arma == 30 and defaultak == 1 then m = 1254 elseif arma == 30 and goldak == 1 then m = 2965 end return m end and got a lot warning messages in debugscript which cause lagging. carmas.Lua:14: Bad argument @ 'createObject' [Expected number at argument 1, got nil] carmas.Lua:15 Bad argument @ 'setElementCollisionsEnabled' [Expected element at argument 1, got boolean] carmas.Lua: 19 Bad argument @ 'destroyElement' [Expected element at argument 1, got boolean] These 3 functions are: jugadores[jug][slot] = createObject(model,0,0,0) -- line 14 error setElementCollisionsEnabled(jugadores[jug][slot],false) -- line 15 error destroyElement(jugadores[jug][slot]) -- line 19 error If I'm using just arma == 30 like this: if arma == 30 then m = 1254 then I get no errors but then I can't seperate/specify objects just only one... and I create every skins to an existing object which I set invisible before... so I must specify the defaultak and the goldak. Can I get this working somehow?
  19. Sorry, I don't wanted to be rude. Ok, now I understand. Changed the model and working. Thanks!
  20. Did you read the question? I want to use that resource which is linked. But if I attach the weapon in player's hand with bone_attach resource then this resource isn't attach the weapon to back.
  21. If I'm attach the weapon with bone_attach then I can't attach the weapon to the player's back? Because I attach the weapon in player's hand with this: local playerInterior = getElementInterior(player) local playerDimension = getElementDimension(player) local x, y, z = getElementPosition(player) ak[player] = createObject(2965,0,0,0) setElementInterior(ak[player], playerInterior) setElementDimension(ak[player], playerDimension) exports['bone_attach']:attachElementToBone(ak[player], player, 12, 0, 0, 0, 0, -90, 0) And using THIS resource to attach the weapon to player's back then it's not moved to anywhere.
  22. I just needed the cameraFireing function the other parts are already done and now works perfect together with your fix. Thank you!