Jump to content

TorNix~|nR

Members
  • Posts

    503
  • Joined

  • Last visited

Everything posted by TorNix~|nR

  1. Thank you for providing help but I tried this and multiple attempts, none of them worked any other help please?
  2. Already tried it, same problem
  3. Hello guys, I get this error when I use the convertNumber method attempt to perform arithmetic on local 'oldZcount' (a string value) function convertNumber ( number ) local formatted = number while true do formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2') if ( k==0 ) then break end end return formatted end --ADJUSTS PLAYERS ZOMBIE KILL SCORE function deanimated( ammo, attacker, weapon, bodypart ) if (attacker) then if (getElementType ( attacker ) == "player") and (getElementType ( source ) == "ped") then if (getElementData (source, "zombie") == true) then -- HERE -- local oldZcount = convertNumber(getElementData ( attacker, "Zombie kills" )) -- HERE -- if oldZcount ~= false then setElementData ( attacker, "Zombie kills", oldZcount+1 ) triggerEvent ( "onZombieWasted", source, attacker, weapon, bodypart ) else setElementData ( attacker, "Zombie kills", 1 ) triggerEvent ( "onZombieWasted", source, attacker, weapon, bodypart ) end end end end end addEventHandler("onPedWasted", resourceRoot, deanimated) any help please?
  4. what kinda save system you want? for example to save weapons, health, position..?
  5. TorNix~|nR

    Object

    @The_GTA, thank you @IIYAMA your method worked, thank you so much
  6. TorNix~|nR

    Object

    is there anyway to use the setObjectBreakable function. in server-side?
  7. TorNix~|nR

    Object

    I made a gate using the object number (990) it can be broken for example by a car, I want to fix it when I used the editor resource just to test it, I made it frozen and it worked (it can not be damaged)
  8. TorNix~|nR

    Object

    Hello everyone, I want to know how to make the object frozen like in the editor I'm using createObject is there anyway to make it frozen?
  9. It's working, thank you so much
  10. I still can click only to players with no hex, I think this is the problem getPlayerFromName(guiGridListGetItemText(gridOpenSenior, guiGridListGetSelectedItem(gridOpenSenior), 1)) can gsub be added to this?
  11. Hello guys, I have a problem, I'm trying to hide hex colors from a grid list and it didn't work for id,player in ipairs(getElementsByType("player")) do local row = guiGridListAddRow(gridlist) setTimer ( guiGridListSetItemText , 100 , 1 , gridlist, row, column, getPlayerName(player):gsub("#%x%x%x%x%x%x", ""), false, false ) end any help please?
  12. I tried that, it's the same
  13. It's working, but a little problem when you change your clothes and change another skin and you reconnect, the clothes are gone, any fix please?
  14. Resource: https://community.multitheftauto.com/index.php?p=resources&s=details&id=10588
  15. Hello guys I'm using my friend @WASSIm.'s script of saving It saves everything except ped clothes, and it have debug problems if (clothes) then for _, cloth in pairs(fromJSON(clothes)) do local type, texture, model = unpack(cloth) addPedClothes(source, type, texture, model) end end function getAllPedClothes(thePed) local clothes = { } for type=0, 17 do local texture, model = getPedClothes(thePed, type) if (texture) and (model) then table.insert(clothes, {type, texture, model}) end end return clothes end fromJSON Expected string at argument 1 got boolean and Expected number, got non-convertible string. This warning may be an error in future versions any help please?
  16. TorNix~|nR

    Admin Panel

    I'm using the latest admin panel I only added logs into it there's not a problem at all I want to know if it is possible that the bug is made by 1 resource
  17. TorNix~|nR

    Admin Panel

    Hello guys, I have a little problem, and I don't know from where it came Sometimes when some players enter the server it starts lagging so much, when I take a look in Admin Panel (the default admin panel) I see that every resource is multiplied by 2, means for example 20 resources become 40 resources, is there any solution please?
  18. Yeah it's working @Tekken the working code: local timerTimer = {}; function sortTimer(plr,timer,time) if plr and timer and time then if isTimer(timerTimer[plr]) then killTimer(timerTimer[plr]); end timerTimer[plr] = setTimer(function(plr) time = time - 60; m,s,cs = msToTimeStr(time); fullTime = m.." M "..s.." S"; textItemSetText(timer,""..tostring(fullTime)..""); if ( tonumber(m) <= 0 and tonumber(s) <= 0 and tonumber(cs) <= 0 ) then stopJailTimer(plr, timer) end end , 50 , 0 ,plr ); end end function stopJailTimer(plr) textDestroyDisplay(TimerDisplay) ------HERE IS THE PROBLEM if TimerText then textDestroyTextItem(TimerText) ------HERE IS THE PROBLEM end if isTimer(timerTimer[plr]) then killTimer(timerTimer[plr]) end end but a little more problem when 2 players are in jail and the timer is counting, when they get out, only the last player get the destroy of the text, but the other it doesn't disappear here's the code: function startJailTimer(plr,jailTime) if plr then TimerDisplay = textCreateDisplay() m,s,cs = msToTimeStr(jailTime) fullTime = m..":"..s TimerText = textCreateTextItem ( ""..tostring(jailTime).."", 0.39, 0.7 ,"medium",255,255,255,255,2.0,"left","center",255) textDisplayAddText ( TimerDisplay, TimerText ) textDisplayAddObserver ( TimerDisplay, plr ) sortTimer(plr,TimerText,jailTime) end end help please?
  19. Sorry, that :~ I think is caused by changing the LUA to HTML I think, it's not like that in my code You think I can use this? local allJailTimers = {}; function jailPlayer(plr,timer,time) if not isTimer(allJailTimers[player]) then if plr and timer and time then if isTimer(timer:~Timer) then killTimer(timer:~Timer) end timer:~Timer = setTimer(function(plr) time = time - 60 m,s,cs = msToTimeStr(time) fullTime = m.." M "..s.." S" textItemSetText(timer,""..tostring(fullTime).."") end , 50 , 0 ,plr ) end end end
  20. I use these in the events time = math.floor(jailTime) startJailTimer(source,time)
  21. Hello guys I have a little problem with this code, when a player enter the jail it start counting the timer without a problem but when another player enter the jail too (means they become 2 in jail), the text timer stop counting for the first player (it freezes for example in Time Left: 0:40 seconds) and start counting for only the second player Code function startJailTimer(source,jailtimex) -- to start mission timer .. if source then TimerDisplay = textCreateDisplay() m,s,cs = msToTimeStr(jailtimex) fullTime = m..":"..s TimerText = textCreateTextItem ( "Time Left: "..tostring(jailTime).."", 0.39, 0.7 ,"medium",255,255,255,255,2.0,"left","center",255) textDisplayAddText ( TimerDisplay, TimerText ) textDisplayAddObserver ( TimerDisplay, source ) sortTimer:~(source,TimerText,jailtimex) end end function msToTimeStr(ms) if not ms then return '' end if ms < 0 then return "0","00","00" end local centiseconds = tostring(math.floor(math.fmod(ms, 1000)/10)) if #centiseconds == 1 then centiseconds = '0' .. centiseconds end local s = math.floor(ms / 1000) local seconds = tostring(math.fmod(s, 60)) if #seconds == 1 then seconds = '0' .. seconds end local minutes = tostring(math.floor(s / 60)) return minutes, seconds, centiseconds end function sortTimer:~(source,timer,time) -- to sort timer's :~ .. if timer and time then if isTimer(timer:~Timer) then killTimer(timer:~Timer) end timer:~Timer = setTimer(function(source) time = time - 60 m,s,cs = msToTimeStr(time) fullTime = m..":"..s textItemSetText(timer,""..tostring(fullTime).."") end , 50 , 0 ,source ) end end function stopJailTimer(source) textDestroyDisplay(TimerDisplay) if TimerText then textDestroyTextItem(TimerText) end if isTimer(timer:~Timer) then killTimer(timer:~Timer) end end any help please?
  22. Problem solved, please any moderator can remove this topic? @Dutchman101
  23. Hello guys, I want to ask how to update my server from 1.5.7 to 1.5.8 without deleting folders is there any way to replace some file?
  24. Thank you, it's working
×
×
  • Create New...