Jump to content

DNL291

Retired Staff
  • Posts

    3,875
  • Joined

  • Days Won

    67

Everything posted by DNL291

  1. Use addCommandHandler para promover o jogador de um nível para outro, defina dados no elemento jogador e defina o nível, adicione no scoreboard. Se não tiver um sistema de gang terá que fazê-lo primeiramente. Sinceramente, o seu português deixou a desejar, fica difícil para qualquer um entender.
  2. DNL291

    car damaging

    Try this: function antiCarDM(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement) if getElementType(hitElement)=="vehicle" then outputChatBox("(( CAR DM IS NOT ALLOWED ))", 255, 0, 0) cancelEvent() end end addEventHandler("onClientPlayerWeaponFire", localPlayer, antiCarDM)
  3. @glowdemon1 Is missing an 'end' to close the setTimer function. And isPlayerInTeam isn't a MTA function, that code must have this function in order to be working.
  4. Se você quer que alguém te ajude terá que explicar melhor, já que poucos devem usar esse recurso. Será melhor ilustrar o seu problema por meio de imagem, ou explicar como funciona o script.
  5. Não, o 2º argumento da sintaxe é uma string. O valor é no 3º argumento, como já expliquei acima.
  6. DNL291

    HELP

    Use: setElementVisibleTo( element, root, false ) setElementVisibleTo( element, player, true )
  7. If you want to move it to a specific position, then use interpolateBetween.
  8. Não sei ao que se refere com checkpoint, pode explicar?
  9. DNL291

    [HELP] Line Break

    That's inefficient. You should use [[ ]] instead. Yes, you can also do this: local text1 = [[Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas nec aliquam mi, nec accumsan augue. Quisque ornare sollicitudin nisl. Vivamus mi orci, pellentesque porttitor sem non, sodales dictum risus. Praesent magna orci, ultrices in nisl quis, euismod dictum mauris. Curabitur cursus laoreet felis sed ullamcorper. Proin faucibus id velit a consequat. Nulla facilisi. Sed fringilla elit nec tortor imperdiet viverra. Curabitur quis neque nec eros feugiat fringilla. Nam a est a mauris mattis cursus sed vitae dolor. Nam non justo blandit, mattis sem eget, pellentesque nibh. Proin quis luctus dolor.]]
  10. Try this: local nemesisBots = {} function BossNemesis ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then for i=1, 10 do local x, y, z = getElementPosition ( thePlayer ) nemesisBots[i] = exports [ "slothBot" ]:spawnBot ( x+i,y+i,z+(i/2), 90, math.random ( 300, 303 ), 0, 0, Nemesis, 38, "hunting", true ) exports.extra_health:setElementExtraHealth ( nemesisBots[i], 150 ) setElementModel ( nemesisBots[i], 107 ) end end end addCommandHandler ( "nemesis",BossNemesis ) addEvent("onBotWasted",true) addEventHandler("onBotWasted",getRootElement(), function (killer) for i, nemesis in ipairs(nemesisBots) do if (source == nemesis) then givePlayerMoney(killer,math.random(1000,1000)) local killerName = getPlayerName(killer) local weapon = getPedWeapon(killer) local wr, wg, wb = getPlayerNametagColor(killer) exports.killmessages:outputMessage ( {killerName,{"padding",width=3},{"icon",id=weapon or 0},{"padding",width=3},{"color",r=141,g=7,b=220},"Nemesis"},getRootElement(),wr,wg,wb ) exports.exp_system:addPlayerEXP ( killer, math.random(1, 200)) break end end end)
  11. Use isPedInVehicle em vez de isPlayerInVehicle, pois esta função já é ultrapassada, como cita no MTA Wiki.
  12. Tente isto. Eu não testei. local playerWeapons = { } local onDeath = false addEventHandler ( "onPlayerWasted", root, function ( ) if ( not playerWeapons [ source ] ) then playerWeapons [ source ] = { } end for slot = 0, 12 do local weapon = getPedWeapon ( source, slot ) if ( weapon > 0 ) then local ammo = getPedTotalAmmo ( source, slot ) if ( ammo > 0 ) then playerWeapons [ source ] [ weapon ] = ammo onDeath = true end end end end ) addEventHandler( "onPlayerQuit", root, function () local account = getPlayerAccount(source) if (account) and not isGuestAccount(account) then savePlayerWeapons(source, account) end if playerWeapons[source] then playerWeapons[source] = nil end end ) function savePlayerWeapons(player, account) if not player then return false end local tWeapons = {} for slot=0, 12 do local weapon = getPedWeapon(player, slot) local ammo = getPedTotalAmmo(player, slot) if (ammo > 0) then tWeapons[weapon] = ammo end end if account then setAccountData(account, "playerWeapons", toJSON(tWeapons)) end return toJSON(tWeapons) end function loadPlayerWeapons(player, onDeath, account) if not player then return false end if (onDeath == true) then if playerWeapons[player] then for weapon, ammo in pairs(playerWeapons[player]) do giveWeapon(player, weapon, ammo) end end return end if not account then return false end local weapons = getAccountData(account, "playerWeapons") if (weapons) then for weapon, ammo in pairs(fromJSON(weapons)) do giveWeapon(player, weapon, ammo, true) end end return weapons end addEventHandler( "onPlayerLogout", root, function (prevAcc) if savePlayerWeapons(source, prevAcc) then takeAllWeapons(source) end onDeath = false end ) addEventHandler( "onPlayerSpawn", root, function () local account = getPlayerAccount(source) if (account and isGuestAccount(account)) or (onDeath) then account = false end loadPlayerWeapons(source, onDeath, account) end )
  13. Você tem que ter o scoreboard modificado para essa finalidade. EDIT Aqui o link: https://community.multitheftauto.com/in ... ls&id=4019
  14. Se você usasse a barra de pesquisa ia encontrar isto: local playerWeapons = { } addEventHandler ( "onPlayerWasted", root, function ( ) if ( not playerWeapons [ source ] ) then playerWeapons [ source ] = { } end for slot = 0, 12 do local weapon = getPedWeapon ( source, slot ) if ( weapon > 0 ) then local ammo = getPedTotalAmmo ( source, slot ) if ( ammo > 0 ) then playerWeapons [ source ] [ weapon ] = ammo end end end end ) addEventHandler ( "onPlayerSpawn", root, function ( ) if ( playerWeapons [ source ] ) then for weapon, ammo in pairs ( playerWeapons [ source ] ) do giveWeapon ( source, tonumber ( weapon ), tonumber ( ammo ) ) end end playerWeapons [ source ] = nil end ) Se você quer que a arma seja salva quando sair do servidor, precisará editar, usando as funções citadas acima.
  15. Change getRootElement to resourceRoot.
  16. Because thePlayer isn't defined anywhere.
  17. Não vejo nenhuma imagem. Corrija o link por favor.
  18. Phyton e Ruby também podem ser usadas para scripting. Inclusive, Ruby foi criada para essa finalidade.
  19. Your code has some things that don't make much sense. Like this: addEventHandler("onResourceStart",jobmarker,function(p) if p == lp and not isPedInVehicle(lp) then guiSetVisible(jobmarker,true) showCursor(true) end end) And you didn't told where's the error, this make it more difficult to help you. Please, type /debugscript 3 whenever there is any error with a script.
  20. Remove the word e at line 41, after math.random(1,2). Also, onResourceStart is a server-side event only.
×
×
  • Create New...