kowixd

Members
  • Content Count

    16
  • Joined

  • Last visited

Community Reputation

0 Neutral

About kowixd

  • Rank
    Square

Recent Profile Visitors

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

  1. I fixed it and add levels thanks for watching
  2. Hello Every time I open the panel it causes lag .. I would also like to list the top list Please Help I do not have much knowledge in this function onWasted(_,killer,_,body) if(killer and getElementType(killer)=="player" and killer~=source)then addPlayerKillCount(killer) end end addEventHandler("onPlayerWasted",root,onWasted) function addPlayerKillCount(p) local acc = getPlayerAccount(p) if(acc and isGuestAccount(acc)==false)then local pk = tonumber((getAccountData(acc,"Players Kills"))) or 0 setAccountData(acc,"Players Kills",pk+1) end end function onChangeNick(old,new) local acc = getPlayerAccount(source) if(acc and isGuestAccount(acc)==false)then local nickAcc = string.gsub(new,"#%x%x%x%x%x%x","") setAccountData(acc,"PlayerName",nickAcc) end end addEventHandler("onPlayerChangeNick",root,onChangeNick) function createTopSystem() local allAccounts = getAccounts() local sendTable = {} local data = 0 for k,v in ipairs(allAccounts) do local name = getAccountName(v) data = tonumber(getAccountData(v,"Players Kills") or 0)or 0 if(data>0)then table.insert(sendTable,{["playerName"] = name,["Value"] = data}) end end table.sort(sendTable,function(a,b) return tonumber(a["Value"] or 0)>tonumber(b["Value"] or 0) end) table.setMaxIndex(sendTable,30) for i=1,#sendTable do local acc = getAccount(sendTable[i]["playerName"]) local accRealName = getAccountData(acc,"PlayerName") if(accRealName and tostring(accRealName)~="false")then sendTable[i]["playerName"] = accRealName end end triggerClientEvent(client,"onClientReceiveTopListTable",client,sendTable) end function table.setMaxIndex(t,n) if(#t>n)then while(#t>n)do table.remove(t) end end end addEvent("onTopPlayerListRequest", true) addEventHandler("onTopPlayerListRequest", root, function() createTopSystem( source ) end ) client.lua local rankTable = {} addEventHandler("onClientResourceStart", resourceRoot, function() JanelaPrincipal = guiCreateWindow(0.34, 0.18, 0.35, 0.61, "TOP 30 PLAYERS KILLS", true) guiSetAlpha(JanelaPrincipal, 1.00) guiSetProperty(JanelaPrincipal, "CaptionColour", "FFF00AF3") guiWindowSetMovable(JanelaPrincipal, false) guiWindowSetSizable(JanelaPrincipal, false) Gridilist = guiCreateGridList(0.04, 0.1, 0.93, 0.83, true, JanelaPrincipal) local column = guiGridListAddColumn(Gridilist, "Rank", 0.20 ) local column1 = guiGridListAddColumn(Gridilist, "Player Name", 0.5) local column2 = guiGridListAddColumn(Gridilist, "Kills", 0.2) for i = 1,30 do local row = guiGridListAddRow ( Gridilist ) guiGridListSetItemText (Gridilist, row, column, "" .. i .. "-", false, false ) guiGridListSetItemText (Gridilist, row, column1, "N/A", false, false ) guiGridListSetItemText (Gridilist, row, column2, "N/A", false, false ) guiGridListSetItemColor(Gridilist, row, column, 255, 0, 0) guiGridListSetItemColor(Gridilist, row, column1, 255, 255, 0) guiGridListSetItemColor(Gridilist, row, column2, 0, 180, 255) end guiSetVisible(JanelaPrincipal,false) end) addEvent("onClientReceiveTopListTable",true) addEventHandler("onClientReceiveTopListTable",root, function(t) rankTable = t UpdateTopList() end) function UpdateTopList() guiGridListClear(Gridilist) local row = guiGridListAddRow ( Gridilist ) for k,v in ipairs(rankTable) do --local row = guiGridListAddRow ( Gridilist ) --guiGridListSetItemText ( Gridilist, row, 1, "" .. i .. "-", false, false ) guiGridListSetItemText(Gridilist,row,2,v["playerName"],false,false) guiGridListSetItemText(Gridilist,row,3,v["Value"],false,false) guiGridListSetItemColor(Gridilist, row, 2, 255, 255, 0) guiGridListSetItemColor(Gridilist, row, 3, 0, 180, 255) end end function ToggleTopGui() local guiS = guiGetVisible(JanelaPrincipal) guiSetVisible(JanelaPrincipal,not guiS) showCursor(not guiS) guiSetInputEnabled(not guiS) triggerServerEvent("onTopPlayerListRequest",localPlayer) end bindKey("F10","down",ToggleTopGui)
  3. ahora eh conseguido que solamente los que estan conectados aparescan en el top, pero quiero que aparescan los que lo no estan tambien _getPlayerName = getPlayerName function getPlayerName(player) return string.gsub(_getPlayerName(player), "#%x%x%x%x%x%x", "" ) end function getPlayersSortByaScore( ) local TopScore = { } for _, aPlayer in next, getElementsByType 'player' do table.insert ( TopScore, { player = aPlayer, aScore = getElementData ( aPlayer, 'Players Kills' ) or 0 } ) end table.sort( TopScore, function( a, b ) return( tonumber( a.aScore ) or 0 ) > ( tonumber( b.aScore ) or 0 ) end ) return TopScore end -------lllllllllllllll------------- local Key = "F10" --- bind key HD = { gridlist = {} } function centerWindow(center_window) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(center_window,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(center_window,x,y,false) end HD.wnd = guiCreateWindow(415, 146, 450, 505, "Top 30 Kill script", false) guiWindowSetSizable(HD.wnd, false) guiSetAlpha(HD.wnd, 1.00) guiSetProperty(HD.wnd, "CaptionColour", "FF2f00fFf") centerWindow(HD.wnd) HD.gridlist[1] = guiCreateGridList(18, 32, 430, 500, false, HD.wnd) local column = guiGridListAddColumn(HD.gridlist[1], "Rank", 0.20 ) local column1 = guiGridListAddColumn(HD.gridlist[1], "Player Name", 0.40 ) local column2 = guiGridListAddColumn(HD.gridlist[1], "Total Kill", 0.30 ) guiSetVisible(HD.wnd, not guiGetVisible(HD.wnd)) bindKey (Key, "down", function() guiSetVisible(HD.wnd, not guiGetVisible(HD.wnd)) showCursor(guiGetVisible(HD.wnd)) end ) 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 setTimer ( function ( ) guiGridListClear( HD.gridlist[1] ) local g = getPlayersSortByaScore( ) for i = 1, 30 do local row = guiGridListAddRow ( HD.gridlist[1] ) if ( g [ i ] )then guiGridListSetItemText ( HD.gridlist[1], row, column, "" .. i .. "-", false, false ) guiGridListSetItemText ( HD.gridlist[1], row, column1, getPlayerName ( g [ i ].player ), false, false ) guiGridListSetItemText ( HD.gridlist[1], row, column2, convertNumber( g [ i ].aScore ), false, false ) guiGridListSetItemColor(HD.gridlist[1], row, column1, 0, 255, 0) guiGridListSetItemColor(HD.gridlist[1], row, column2, 0, 180, 255) guiGridListSetItemColor(HD.gridlist[1], row, column, 255, 0, 0) end end end , 1000, 0 ) server.lua function onWasted(_,killer,_,body) if(killer and getElementType(killer)=="player" and killer~=source)then setElementData ( killer, "Players Kills", ( getElementData ( killer, "Players Kills" ) or 0 )+1 ) end end addEventHandler("onPlayerWasted",root,onWasted) addEventHandler ( "onPlayerQuit", root, function ( ) local playerAcc = getPlayerAccount ( source ) if playerAcc and not isGuestAccount ( playerAcc ) then local score = getElementData ( source, "Players Kills" ) if score then setAccountData ( playerAcc, "Players Kills", score ) end end end ) addEventHandler ( "onPlayerLogin", root, function ( _, playerAcc ) local score = getAccountData ( playerAcc, "Players Kills" ) if score then setTimer ( setElementData, 1000, 1, source, "Players Kills", score ) end end )
  4. Hola, quisiera hacer un top 30 de los jugadores con mas kills, pero de esto desconosco hice algo pero, no tiene logica alguna.. en especial en el server.lua Si me podrian dejar un par de comentarios explicando cada cosa estaria agradecido. local Key = "F10" --- bind key HD = { gridlist = {}, S3D = {}, q = {} } function centerWindow(center_window) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(center_window,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(center_window,x,y,false) end HD.wnd = guiCreateWindow(415, 146, 450, 505, "Top 30 Kill Script || ", false) guiWindowSetSizable(HD.wnd, false) guiSetAlpha(HD.wnd, 1.00) guiSetProperty(HD.wnd, "CaptionColour", "FFF00FFF") centerWindow(HD.wnd) HD.gridlist[1] = guiCreateGridList(18, 36, 430, 500, false, HD.wnd) local column = guiGridListAddColumn(HD.gridlist[1], "Rank", 0.20 ) local column1 = guiGridListAddColumn(HD.gridlist[1], "Player Name", 0.30 ) local column2 = guiGridListAddColumn(HD.gridlist[1], "Total Kill", 0.20 ) local column3 = guiGridListAddColumn(HD.gridlist[1], "Total Deaths", 0.20 ) for i = 1,30 do local row = guiGridListAddRow ( HD.gridlist[1] ) guiGridListSetItemText ( HD.gridlist[1], row, column, "" .. i .. "-", false, false ) guiGridListSetItemText ( HD.gridlist[1], row, column1, "N/A", false, false ) guiGridListSetItemText ( HD.gridlist[1], row, column2, "N/A", false, false ) guiGridListSetItemText ( HD.gridlist[1], row, column3, "N/A", false, false ) guiGridListSetItemColor(HD.gridlist[1], row, column1, 255, 255, 0) guiGridListSetItemColor(HD.gridlist[1], row, column2, 0, 180, 255) guiGridListSetItemColor(HD.gridlist[1], row, column3, 0, 180, 255) guiGridListSetItemColor(HD.gridlist[1], row, column, 255, 0, 0) end guiSetVisible(HD.wnd, not guiGetVisible(HD.wnd)) bindKey (Key, "down", function() guiSetVisible(HD.wnd, not guiGetVisible(HD.wnd)) showCursor(guiGetVisible(HD.wnd)) triggerServerEvent("onTopPlayerListRequest", localPlayer) end ) 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 function updateTopList(playerName, Value, i) local row = guiGridListAddRow ( HD.gridlist[1] ) guiGridListSetItemText ( HD.gridlist[1], row, column, "" .. i .. "-", false, false ) guiGridListSetItemText ( HD.gridlist[1], row, column1, tostring(playerName), false, false ) guiGridListSetItemText ( HD.gridlist[1], row, column2, convertNumber(Value), false, false ) guiGridListSetItemColor(HD.gridlist[1], row, column1, 255, 255, 0) guiGridListSetItemColor(HD.gridlist[1], row, column2, 0, 180, 255) guiGridListSetItemColor(HD.gridlist[1], row, column, 255, 0, 0) end addEvent("onClientReceiveTopListTable", true) addEventHandler("onClientReceiveTopListTable", root, updateTopList) function update() guiGridListClear(HD.gridlist[1]) end addEvent("deltTop", true) addEventHandler("deltTop", root, update) addEventHandler( 'onResourceStart', getResourceRootElement(getThisResource()), function( ) outputChatBox("==[ Top-30 Kill Script | By K0w1 ]==", root, 255, 125, 0,true) outputChatBox("==[ Press F10 To Open Top-30 Top-Kill Script ]==", root, 50, 255, 0,true) end ) function onWasted(_,killer,_,body) if(killer and getElementType(killer)=="player" and killer~=source)then addPlayerKillCount(killer) addWastedCount(source) end if(killer and getElementType(killer)~="player" and killer~=source)then addWastedCount(source) end end addEventHandler("onPlayerWasted",root,onWasted) function addPlayerKillCount(p) local acc = getPlayerAccount(p) if(acc and isGuestAccount(acc)==false)then local pk = tonumber((getAccountData(acc,"Kills"))) or 0 setAccountData(acc,"Kills",pk+1) end end function addWastedCount(p) local acc = getPlayerAccount(p) if(acc and isGuestAccount(acc)==false)then local w = tonumber((getAccountData(acc,"Wasted"))) or 0 setAccountData(acc,"Wasted",w+1) end end function onChangeNick(old,new) local acc = getPlayerAccount(source) if(acc and isGuestAccount(acc)==false)then local nickAcc = string.gsub(new,"#%x%x%x%x%x%x","") setAccountData(acc,"PlayerName",nickAcc) end end addEventHandler("onPlayerChangeNick",root,onChangeNick) addEvent("onTopPlayerListRequest",true) addEventHandler("onTopPlayerListRequest",root, function ( player, text ) if not isElement( player ) then return end local name = getAccountName(player) local sendTable = {} data = tonumber(getAccountData(player,"Kills") or 0)or 0 for i = 1, #data do table.insert(sendTable,{["playerName"] = name,["Value"] = data}) end if #CreatTop >0 then table.sort(sendTable,function(a,b) return tonumber(a["Value"] or 0)>tonumber(b["Value"] or 0) end) setTimer( function() for k, data in ipairs(sendTable) do if k == 1 then triggerClientEvent (player,"deltTop",player) end triggerClientEvent (player,"onClientReceiveTopListTable",player,tostring(data.name),tostring(data.score),tonumber(k)) if k == 30 then table.remove(sendTable) break end end end, 500, 1 ) end end)
  5. ERROR: Loading script failed: afk2\server.lua: 'then' expected near 'local' ......(line 7)
  6. kowixd

    Como puedo....

    local account = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user." .. account, aclGetGroup("GrupoACL")) then --Tu codigo end No te entiendo muy bien, pero te refieres a eso?
  7. @LimoN>w< si tienes el recurso "heligrab" el bind de "blackspace" se debe a eso ya que tiene un bind con "drop" ese recurso for key, state in pairs(getBoundKeys("jump")) do bindKey(key, "down", "grab") end --bindKey("lshift", "down", "grab", "") bindKey("backspace", "down", "drop", "") end
  8. Hola, quisiera que cuando un jugador escriba /afk por arriba de su cabeza unas letras que diga AFK y cuando escriba /noafk estas desaparescan. Nose muy bien como usar usar el dxDrawText, por favor AYUDA Aqui les dejo el scrip del AFK: Hello, I would like that when a player writes / afk above his head some letters that say AFK and when he writes / noafk they disappear. I do not know how to use the dxDrawText, please HELP Here is the AFK scrip: addEventHandler("onPlayerJoin",getRootElement(), function () setElementData(source,"afk_state","back") setElementData(source,"HideState","disabled") --setElementData(source,"tafk",false) end) addEventHandler( "onResourceStart", getResourceRootElement(getThisResource()), function () for i,v in pairs (getElementsByType("player")) do setElementData(v,"afk_state","back") setElementData(v,"HideState","disabled") setElementData(v,"tafk",false) setElementData(v,"invencible",false) end end) function afkstart(player) local vida = getElementHealth ( player ) if getElementData(player,"afk_state") == "back" then local state = ( not getElementData ( player, "invencible" ) ) if vida < 35 then return outputChatBox ("No puedes ir AFK con la vida baja!",player,255,0,0) end if getElementData (player, "tafk", true) then outputChatBox ('#00FF00Espere 10 segundos...',player,255,0,0,true) return end local id2 = getPedWeapon (player) triggerClientEvent(player,"god_mode",player) setElementData ( player, "invencible", state ) --outputChatBox ( "AFK ".. ( state and "Activado" or "Desactivado" ) ..".", player, 255, 0, 0 ) setElementFrozen(player,true) setPlayerNametagText (player, "|AFK|" .. getPlayerName ( player )) outputChatBox(getPlayerName(player).." #ff0000 esta AFK!",getRootElement(),0,255,0, true) setElementData(player,"afk_state","afk") if id2 > 15 then giveWeapon (player, 0, 1, true) end setElementData (player, "tafk",true) toggleControl (player, "fire", false) toggleControl (player, "next_weapon", false) toggleControl (player, "previous_weapon", false) toggleControl ( player, 'vehicle_fire', false ) toggleControl (player, "aim_weapon", false) bindKey (player,"w","down","noafk") bindKey (player,"d","down","noafk") bindKey (player,"s","down","noafk") bindKey (player,"a","down","noafk") bindKey (player,"num_0","down","noafk") bindKey (player,"lctrl","down","noafk") bindKey (player,"arrow_u","down","noafk") bindKey (player,"arrow_d","down","noafk") bindKey (player,"arrow_l","down","noafk") bindKey (player,"arrow_r","down","noafk") bindKey (player,"delete","down","noafk") bindKey (player,"mouse2","down","noafk") bindKey (player,"capslock","down","noafk") if getPedOccupiedVehicle(player) then fixVehicle(getPedOccupiedVehicle(player),true) setElementFrozen(getPedOccupiedVehicle(player),true) setVehicleDamageProof(getPedOccupiedVehicle(player),true) end setElementData (player, "tafk",true) setTimer (setElementData, 10000, 1, player, "tafk", false) end end addCommandHandler("afk", afkstart ) function afkend(player) if getElementData(player,"afk_state") == "afk" then local state = ( not getElementData ( player, "invencible" ) ) setElementData(player,"afk_state","back") triggerClientEvent(player,"disable_god_mode",player) setElementFrozen(player,false) setPlayerNametagText (player, "" .. getPlayerName (player)) outputChatBox(getPlayerName(player).." #00ff00 ya no esta AFK!",getRootElement(),0,255,0, true) toggleControl (player, "fire", true) toggleControl (player, "next_weapon", true) toggleControl (player, "previous_weapon", true) toggleControl ( player, 'vehicle_fire', true ) toggleControl (player, "aim_weapon", true) setElementData ( player, "invencible", state ) --outputChatBox ( "AFK " .. ( state and "Activado" or "Desactivado" ) ..".", player, 255, 0, 0 ) unbindKey (player,"w","down","noafk") unbindKey (player,"d","down","noafk") unbindKey (player,"s","down","noafk") unbindKey (player,"a","down","noafk") unbindKey (player,"num_0","down","noafk") unbindKey (player,"lctrl","down","noafk") unbindKey (player,"arrow_u","down","noafk") unbindKey (player,"arrow_d","down","noafk") unbindKey (player,"arrow_l","down","noafk") unbindKey (player,"arrow_r","down","noafk") unbindKey (player,"delete","down","noafk") unbindKey (player,"mouse2","down","noafk") unbindKey (player,"capslock","down","noafk") if getPedOccupiedVehicle(player) then setElementFrozen(getPedOccupiedVehicle(player),false) setVehicleDamageProof(getPedOccupiedVehicle(player),false) end end end addCommandHandler("noafk", afkend ) addCommandHandler("wp", afkend ) addCommandHandler("weapon", afkend ) addCommandHandler("dim", afkend ) addEventHandler( "onResourceStop", getResourceRootElement(getThisResource()), function () for i,v in pairs (getElementsByType("player")) do setElementData(v,"afk_state","back") setElementData(v,"HideState","disabled") --setElementData(v,"tafk",false) setElementData(v,"invencible",false) end end)
  9. ok, thanks
  10. no work Bad argument @ 'getElementData' [Expected element at argument 1
  11. Hello, I want it to be impossible to shoot while this / afk I use toggleControl (player, "fire", false) but this bug in freeroam server ( I think) and allow to shoot HELP please addEventHandler("onPlayerJoin",getRootElement(), function () setElementData(source,"afk_state","back") setElementData(source,"HideState","disabled") setElementData(source,"tafk",false) end) addEventHandler( "onResourceStart", getResourceRootElement(getThisResource()), function () for i,v in pairs (getElementsByType("player")) do setElementData(v,"afk_state","back") setElementData(v,"HideState","disabled") setElementData(v,"tafk",false) end end) function afkstart(player) local vida = getElementHealth ( player ) local x, y, z = getElementPosition ( player ) local interior = getElementInterior (player ) local dim = getElementDimension (player) if getElementData(player,"afk_state") == "back" then if vida < 35 then return outputChatBox ("No puedes ir AFK con la vida baja!",player,255,0,0) end if getElementData (player, "tafk", true) then outputChatBox ('#00FF00Espere 10 segundos...',player,255,0,0,true) return end local id2 = getPedWeapon (player) triggerClientEvent(player,"god_mode",player) setElementFrozen(player,true) setPlayerNametagText (player, "|AFK|" .. getPlayerName (player)) outputChatBox(getPlayerName(player).." #ffff00 is AFK!",getRootElement(),255,50,0, true) setElementData(player,"afk_state","afk") if id2 > 0 then giveWeapon (player, 0, 1, true) end theMarker = createMarker ( x, y, z-1.5, "cylinder", 1.5, 0, 255, 0, 170 ) setElementInterior(theMarker, interior, x, y, z-1.5) setElementDimension(theMarker, dim, interior, x, y, z-1.5) toggleControl (player, "fire", false) toggleControl (player, "next_weapon", false) toggleControl (player, "previous_weapon", false) toggleControl ( player, 'vehicle_fire', false ) toggleControl (player, "aim_weapon", false) bindKey (player,"w","down","noafk") bindKey (player,"d","down","noafk") bindKey (player,"s","down","noafk") bindKey (player,"a","down","noafk") bindKey (player,"num_0","down","noafk") bindKey (player,"lctrl","down","noafk") --bindKey (player,"mouse1","down","noafk") bindKey (player,"arrow_u","down","noafk") bindKey (player,"arrow_d","down","noafk") bindKey (player,"arrow_l","down","noafk") bindKey (player,"arrow_r","down","noafk") if getPedOccupiedVehicle(player) then fixVehicle(getPedOccupiedVehicle(player),true) setElementFrozen(getPedOccupiedVehicle(player),true) setVehicleDamageProof(getPedOccupiedVehicle(player),true) end setElementData (player, "tafk",true) setTimer (setElementData, 10000, 1, player, "tafk", false) end end addCommandHandler("afk", afkstart ) function afkend(player) if getElementData(player,"afk_state") == "afk" then setElementData(player,"afk_state","back") triggerClientEvent(player,"disable_god_mode",player) setElementFrozen(player,false) setPlayerNametagText (player, "" .. getPlayerName (player)) outputChatBox(getPlayerName(player).." #ffff00is back!",getRootElement(),0,255,0, true) toggleControl (player, "fire", true) toggleControl (player, "next_weapon", true) toggleControl (player, "previous_weapon", true) toggleControl ( player, 'vehicle_fire', true ) toggleControl (player, "aim_weapon", true) destroyElement(theMarker) unbindKey (player,"w","down","noafk") unbindKey (player,"d","down","noafk") unbindKey (player,"s","down","noafk") unbindKey (player,"a","down","noafk") unbindKey (player,"num_0","down","noafk") unbindKey (player,"lctrl","down","noafk") --unbindKey (player,"mouse1","down","noafk") unbindKey (player,"arrow_u","down","noafk") unbindKey (player,"arrow_d","down","noafk") unbindKey (player,"arrow_l","down","noafk") unbindKey (player,"arrow_r","down","noafk") if getPedOccupiedVehicle(player) then setElementFrozen(getPedOccupiedVehicle(player),false) setVehicleDamageProof(getPedOccupiedVehicle(player),false) end end end addCommandHandler("noafk", afkend ) addEventHandler( "onResourceStop", getResourceRootElement(getThisResource()), function () for i,v in pairs (getElementsByType("player")) do setElementData(v,"afk_state","back") setElementData(v,"HideState","disabled") setElementData(v,"tafk",false) end end)
  12. thanks but, it only makes it look in the dimension 5 It works, thank you!!
  13. Can you explain me more please? what do you mean by "for iteration btw" Sorry, I'm still starting on this