Jump to content

Anubhav

Members
  • Posts

    2,277
  • Joined

  • Last visited

Everything posted by Anubhav

  1. Anubhav

    SOLVED

    function onDie( ) if isTimer( timing ) and #getElementsWithinColShape( theShape ) == 0 then killTimer( timing ) end end addEventHandler( "onPlayerWasted", root, onDie ) addEventHandler( "onPlayerQuit", root, onDie ) addEventHandler( "onMarkerLeave", root, onDie ) .
  2. "ALTER TABLE table_name ADD IF NOT EXISTS columd_name DATATYPE" i guess this
  3. Anubhav

    The last reply

    "lol" this section doesn't count posts. its spam section, he knows that. it is a joke
  4. Thanks for the correction Welcome
  5. Wrong. It is not like that. The server side script loads and then whenever that event is triggered, that function is already loaded so the function is triggered. Also, may I see your events table? I guess that is the problem or do you sort the table using table.sort?
  6. --Client Draw with my Lib for id, value in pairs(killerTable) do local number = id:gsub( "Name", "" ) if tonumber(number) == tonumber(1) then dxLibTopwinners(ddKill.posT,(sY*0.038+34*scale),sizeXT,sizeYT,killerTable[id].playerName,1*font_size,fontTopKillers,255,255,255,ddKill.alphaT[1],0,0,0,ddKill.alphaT[2],sizeYT*0.8,sizeYT*0.8,255,136,0,ddKill.alphaT[1],"Kills: "..killerTable[id].playerKills or "?","Hits: ".."",false,false) return end if tonumber(number) == tonumber(2) then dxLibTopwinners(ddKill.posT,(sY*0.038+34*scale)+sizeYT*1.05,sizeXT,sizeYT,killerTable[id].playerName,1*font_size,fontTopKillers,255,255,255,ddKill.alphaT[1],0,0,0,ddKill.alphaT[2],sizeYT*0.8,sizeYT*0.8,105,105,105,ddKill.alphaT[1],"Kills: "..killerTable[id].playerKills or "?","Hits: ".."",false,false) return end if tonumber(number) == tonumber(3) then dxLibTopwinners(ddKill.posT,(sY*0.038+34*scale)+sizeYT*1.05*2,sizeXT,sizeYT,killerTable[id].playerName,1*font_size,fontTopKillers,255,255,255,ddKill.alphaT[1],0,0,0,ddKill.alphaT[2],sizeYT*0.8,sizeYT*0.8,139,54,38,ddKill.alphaT[1],"Kills: "..killerTable[id].playerKills or "?","Hits: ".."",false,false) return end --The next line is the 146 if tonumber(number) >= tonumber(4) and tonumber(number) <= tonumber(8) then dxLibToptime(ddKill.posT,(sY*0.038+34*scale)+sizeYT*1.05*(id-1),sizeXT,sizeYT,killerTable[id].playerName,1*font_size,fontTopKillers,255,255,255,ddKill.alphaT[1],0,0,0,ddKill.alphaT[2],sizeYT*0.8,sizeYT*0.8,45,60,81,ddKill.alphaT[1],id,"Kills: "..killerTable[id].playerKills or "?","Hits: ".."",1.2*font_size,false,false) return end end You did not use "return", now give it a try.
  7. https://community.multitheftauto.com/in ... s&id=13013 All mods.
  8. Anubhav

    The last reply

    OKSHHAEEEEEEEEEF Why fight when you know I'm gonna win?
  9. EDIT: My bad. It should be pairs. You probably don't know how tables works. pairs still gives you the index. if the index ['player'] it will show that. and if you want to check it's value you can use table.something or table['player'].something or v.something. They're the samething. Just different methods.
  10. If you don't know tables, please don't speak... Have you ever tried killerTable[id].playerName ? I have tried, it returns nil. You bet? Try this. t1 = { ['hi']="yo", [2]="this" } for i, v in ipairs( t1 ) do outputChatBox( "Anubhav: "..t1[i].." Ozulus:"..v ) end EDIT: I found the problem. The error shows your comparing is wrong, ozulus, you were wrong here. The problem I think is that id is not a number causing nil value. --Server Trigger to client function addInto() for i=1,5 do if ( not killerTable["Name"..i] ) then killerTable["Name"..i] = {playerName = "Name "..i, playerKills = 0} end killerTable["Name"..i].playerKills = killerTable["Name"..i].playerKills + (math.random(1,8)) triggerClientEvent(getRootElement(), "sendClientToTable", resourceRoot, killerTable) outputChatBox("Added Correctly") end end addCommandHandler("add",addInto) -- Trigger Client Side function blabla(tableFromServerside) --killerTable = {} killerTable = tableFromServerside if killerTable then table.sort (killerTable, function (a, b) return a.playerKills > b.playerKills end) end outputChatBox("Table Triggered Correctly") end addEvent("sendClientToTable", true) addEventHandler("sendClientToTable", root, blabla) --Client Draw with my Lib for id, value in pairs(killerTable) do local number = id:gsub( "Name", "" ) if tonumber(number) == tonumber(1) then dxLibTopwinners(ddKill.posT,(sY*0.038+34*scale),sizeXT,sizeYT,killerTable[id].playerName,1*font_size,fontTopKillers,255,255,255,ddKill.alphaT[1],0,0,0,ddKill.alphaT[2],sizeYT*0.8,sizeYT*0.8,255,136,0,ddKill.alphaT[1],"Kills: "..killerTable[id].playerKills or "?","Hits: ".."",false,false) end if tonumber(number) == tonumber(2) then dxLibTopwinners(ddKill.posT,(sY*0.038+34*scale)+sizeYT*1.05,sizeXT,sizeYT,killerTable[id].playerName,1*font_size,fontTopKillers,255,255,255,ddKill.alphaT[1],0,0,0,ddKill.alphaT[2],sizeYT*0.8,sizeYT*0.8,105,105,105,ddKill.alphaT[1],"Kills: "..killerTable[id].playerKills or "?","Hits: ".."",false,false) end if tonumber(number) == tonumber(3) then dxLibTopwinners(ddKill.posT,(sY*0.038+34*scale)+sizeYT*1.05*2,sizeXT,sizeYT,killerTable[id].playerName,1*font_size,fontTopKillers,255,255,255,ddKill.alphaT[1],0,0,0,ddKill.alphaT[2],sizeYT*0.8,sizeYT*0.8,139,54,38,ddKill.alphaT[1],"Kills: "..killerTable[id].playerKills or "?","Hits: ".."",false,false) end --The next line is the 146 if tonumber(number) >= tonumber(4) and tonumber(number) <= tonumber(8) then dxLibToptime(ddKill.posT,(sY*0.038+34*scale)+sizeYT*1.05*(id-1),sizeXT,sizeYT,killerTable[id].playerName,1*font_size,fontTopKillers,255,255,255,ddKill.alphaT[1],0,0,0,ddKill.alphaT[2],sizeYT*0.8,sizeYT*0.8,45,60,81,ddKill.alphaT[1],id,"Kills: "..killerTable[id].playerKills or "?","Hits: ".."",1.2*font_size,false,false) end end This should work!
  11. It is the samething. id is the index and value is the value of that index. So killerTable[id].playerName = value.playerName
  12. You could use createWeapon and attach it onto hand use shaders for the transparence, I guess. Good idea! Thanks!
  13. No, I don't mean that. I want to transform a melee weapon to make it look like fire.
  14. There is no way to make a melee way to make it fire? because I can't use setWeaponProperty. Any other functions which can help? I don't want shaders.
  15. Does setWeaponProperty work on poolcue and such weapons?
  16. This is a forum for helping in scripts not for your personal problems. https://forum.multitheftauto.com/viewforum.php?f=104 Go here and post your personal problems. Sorry for being mean!
  17. local playerName = getPlayerName( killerTable[ player ] )
×
×
  • Create New...