Jump to content

Ragnar

Members
  • Posts

    23
  • Joined

  • Last visited

About Ragnar

  • Birthday 11/04/1999

Details

  • Gang
    Exército Pagão
  • Location
    Suécia
  • Occupation
    Lagertha

Recent Profile Visitors

436 profile views

Ragnar's Achievements

Civilian

Civilian (7/54)

1

Reputation

  1. Tem na comunidade: https://community.multitheftauto.com/index.php?p=resources&s=details&id=1970 Funciona só se você tiver dentro do veículo.
  2. Ola, Estou com esse error: \deleter_s.Lua:103: attempt to concatenate local 'pAccount' (a userdata value) Acontece quando digito: mdel e mclear. Que deveria excluir os diretórios. Code Server-Side: addCommandHandler ( "mdel", function ( player, _, modDir, modName ) if not hasRights ( player ) then return false end if type ( modDir ) ~= "string" or type ( modName ) ~= "string" then outputDebugString ( "Please enter valid arguments! use 'mdel [moddir] [modname]'!" ) return false end local txd = modDir.."/"..modName..".txd" local dff = modDir.."/"..modName..".dff" local hnd = modDir.."/"..modName..".hnd" if fileExists ( txd ) then fileDelete ( txd ) xmlDestroyNode ( mods[txd] ) outputDebugString ( "Deleted TXD in "..modDir.." for item "..modName ) end if fileExists ( dff ) then fileDelete ( dff ) xmlDestroyNode ( mods[dff] ) outputDebugString ( "Deleted DFF in "..modDir.." for item "..modName ) end if fileExists ( hnd ) then fileDelete ( hnd ) outputDebugString ( "Deleted handling in "..modDir.." for item "..modName ) end outputDebugString ( "Deleted mod "..modName..". Restarting resource.." ) restartResource ( ) return true end ) addCommandHandler ( "mclear", function ( player, _, modDir ) if not hasRights ( player ) then return false end if type ( modDir ) ~= "string" then outputDebugString ( "Please enter valid arguments! use 'mclear [moddir]'!" ) return false end local tab if modDir == "vehicles" then tab = validVehicleModels elseif modDir == "weapons" then tab = validWeaponModels elseif modDir == "skins" then tab = validPedModels else outputDebugString ( "Please use a valid mod directory! Valids are: 'vehicles', 'weapons', 'skins'." ) return false end for modelName,modelID in pairs ( tab ) do local txd = modDir.."/"..modelName..".txd" local dff = modDir.."/"..modelName..".dff" local hnd = modDir.."/"..modelName..".hnd" if fileExists ( txd ) then fileDelete ( txd ) xmlDestroyNode ( mods[txd] ) outputDebugString ( "Deleted TXD in "..modDir.." for item "..modelName ) end if fileExists ( dff ) then fileDelete ( dff ) xmlDestroyNode ( mods[dff] ) outputDebugString ( "Deleted DFF in "..modDir.." for item "..modelName ) end if fileExists ( hnd ) then fileDelete ( hnd ) outputDebugString ( "Deleted handling in "..modDir.." for item "..modelName ) end end outputDebugString ( "Cleared mod directory "..modDir..". Restarting resource.." ) restartResource ( ) return true end ) function hasRights ( player ) if getElementType ( player ) == "Console" then return true end local pAccount = getPlayerAccount ( player ) if isGuestAccount ( pAccount ) then return false end if isObjectInACLGroup ( "user."..pAccount, aclGetGroup ( "Admin" ) ) then return true end return false end
  3. Passei longe da forma que tentei ? Obrigado @Lord Henry
  4. Olá, Como faço pra colocar tempo ao comprar vidar juntamente com mensagem de erro, caso o Jogador tente comprar vida 2 vezes seguidas antes de 30 segundos? Se ele tentou compra vida novamente antes dos 30 segundos, então: outputChatBox("[ERRO]: Espere 30 segundos para comprar vida novamente!",thePlayer, 255, 0, 0) Code: function buyhealth ( thePlayer ) local money = getPlayerMoney ( thePlayer ) if money >= 250 then outputChatBox ('* ' .. getPlayerName(thePlayer) .. ':#696969 Vᴏᴄᴇ ᴄᴏᴍᴘʀᴏᴜ [#00FF00/ᴠɪᴅᴀ#696969] Pᴏʀ: #00FF00R$: 5000', thePlayer, 255, 0, 0, true) local thePlayerhealth = getElementHealth ( thePlayer ) setElementHealth ( thePlayer, 569 ) takePlayerMoney ( thePlayer, 5000 ) else outputChatBox("A Vida Custa 5000$!",thePlayer, 255, 0, 0) end end addCommandHandler ( "vida", buyhealth )
  5. Lua:5: Bad argument @ 'destroyElement' [Expected element at argument 1]
  6. Desta forma? function playerQuit() local playerBlips = playerBlips[source] destroyElement(playerBlips) playerBlips[source] = nil end addEventHandler("onPlayerQuit", root, playerQuit) function player_Wasted() local playerBlips = playerBlips[source] destroyElement(playerBlips) playerBlips[source] = nil end addEventHandler("onPlayerWasted", root, player_Wasted)
  7. Quando troco de skin pelo F1 ou pelo Pickup no mapa, ele seta o blip, mas quando morre o blip continua, ele não reconhece que skin foi alterada depois de morto. Teria que ser função onClientRender só que pra server-side? edit: Quando o Jogador sai do server, o blip continua lá também.
  8. playerBlips = { } function oi () for index,value in ipairs(getElementsByType("player")) do if( playerBlips [ value ] ) then destroyElement( playerBlips[ value ] ) playerBlips [ value ] = nil end playerBlips[ value ] = createBlipAttachedTo ( value, 0,2,130,10,230) setElementVisibleTo(playerBlips[value],getRootElement( ),false) if(getTeamName(getPlayerTeam(value)) == "Preto") then for index1,value1 in ipairs(getElementsByType("player")) do if(getTeamName(getPlayerTeam(value1)) == "Preto") then setElementVisibleTo(playerBlips[value],value1,true) end end elseif(getTeamName(getPlayerTeam(value)) == "Colorido") then for index1,value1 in ipairs(getElementsByType("player")) do if(getTeamName(getPlayerTeam(value1)) == "Colorido") then setElementVisibleTo(playerBlips[value],value1,true) end end elseif(getTeamName(getPlayerTeam(value)) == "ForaPvP") then for index1,value1 in ipairs(getElementsByType("player")) do if(getTeamName(getPlayerTeam(value1)) == "ForaPvP") then setElementVisibleTo(playerBlips[value],value1,true) end end end end end addEventHandler("onElementModelChange",getRootElement(),oi) O recurso funciona na seguinte forma: Os Blip só são visíveis para cada time. O team "ForaPvp" são os que morreram... daí o que acontece é que quando o jogador morre o blip do time que ele estava continua visível, exemplo: o time Preto. Queria que quando o player morresse ele só conseguir ver o Blip dos cara que ta no team ForaPvP. Edit: Server-Side
  9. Exatamente do jeito que eu queria! Grato @DNL291
  10. local acls = { "Admin", "RPC", "Console" } Quem está dentro destas acl não conseguem usar o comando, mas quem tá fora sim. não mostra aviso no debugscript O que há de errado?
  11. addCommandHandler("a", function(playerSource) if hasObjectPermissionTo(playerSource,"command.run",true) then for i, v in ipairs(getElementsByType("player")) do if not isPedInVehicle(v) then if getElementData(v,"frozenped") == "false" or not getElementData(v,"frozenped") then setElementFrozen(v,true) toggleAllControls(v,false) setElementData(v,"frozenped","true") outputChatBox("[WARNING]: #FFFFFFTᴏᴅᴏs ᴏs ᴊᴏɢᴀᴅᴏʀᴇs ғᴏʀᴀᴍ ᴄᴏɴɢᴇʟᴀᴅᴏs ᴘᴏʀ: "..getPlayerName(playerSource).."!",v,255,0,0,true) else setElementFrozen(v,false) toggleAllControls(v,true) setElementData(v,"frozenped","false") outputChatBox("[WARNING]: #FFFFFFTᴏᴅᴏs ᴏs ᴘʟᴀʏᴇʀs ғᴏʀᴀᴍ ᴅᴇsᴄᴏɴɢᴇʟᴀᴅᴏs ᴘᴏʀ: "..getPlayerName(playerSource).."!",v,0,255,0,true) end else if getElementData(v,"frozenveh") == "false" or not getElementData(v,"frozenveh") then setElementFrozen(getPedOccupiedVehicle(v),true) setElementData(v,"frozenveh","true") outputChatBox("[WARNING]: #FFFFFFTᴏᴅᴏs ᴏs ᴊᴏɢᴀᴅᴏʀᴇs ғᴏʀᴀᴍ ᴄᴏɴɢᴇʟᴀᴅᴏs ᴘᴏʀ: "..getPlayerName(playerSource).."!",v,255,0,0,true) elseif getElementData(v,"frozenveh") == "true" then setElementFrozen(getPedOccupiedVehicle(v),false) setElementData(v,"frozenveh","false") outputChatBox("[WARNING]: #FFFFFFTᴏᴅᴏs ᴏs ᴘʟᴀʏᴇʀs ғᴏʀᴀᴍ ᴅᴇsᴄᴏɴɢᴇʟᴀᴅᴏs ᴘᴏʀ: "..getPlayerName(playerSource).."!",v,0,255,0,true) end end end elseif hasObjectPermissionTo(playerSource,"command.run",false) then outputChatBox("[WARNING]: #FFFFFFDesculpe,você não tem permisssão para congelar todos os jogadores!",playerSource,255,0,0,true) end end ) Olá, Este recurso congela todos jogadores do server... Queria que NÃO congelasse os que estão em determinadas acl's: Admin, RPC, Console, etc... Então usaria? isPlayerInACL
  12. Muito obrigado @MaligNos ?
×
×
  • Create New...