Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 26/09/19 in all areas

  1. I have heard about this issue before, but not sure if people actually fixed it. The object orientation is updated every frame. But for some unknown reason there is a little delay. With other words: I don't know. Maybe add an extra eventHandler in file bone_attach_c.Lua: addEventHandler("onClientPreRender",root,putAttachedElementsOnBones) --[[ line 85 ]] addEventHandler("onClientRender",root,putAttachedElementsOnBones) --[[ NEW on line 86 ]] If you look at the event order: https://wiki.multitheftauto.com/wiki/Game_Processing_Order You can see that onClientPreRender event first fires and onClientRender fires as last. Maybe if updates are applied on both moments it could be a little bit smoother. Could could could > so not sure.
    2 points
  2. Como está seu meta.xml?
    1 point
  3. Sua lógica de criação do plantas e colP está errada. Você precisa colocá-los em uma table vazia antes de criá-los. Senão a variável sempre será substituída a cada execução do loop. Isso significa que ao final do loop, você criou vários plantas e vários colP, mas somente o último pode ser acessado pelo script, pois são os únicos que estão nas variáveis plantas e colP, os outros ficaram sem variável para serem chamados. Dessa forma, somente 1 planta e 1 colP funcionam. dff = engineLoadDFF("grassplant01.dff") engineReplaceModel(dff, 3409) addCommandHandler("devmode", function() setDevelopmentMode(true) end ) plantas = { {-1014, -1609.2, 75.36}, {-1010, -1609.242, 75.367}, {-1006, -1609.19, 75.36}, {-1002, -1609.104, 75.36}, {-998, -1609.082, 75.36}, {-994, -1609.037, 75.36}, {-990, -1609.037, 75.36}, {-1014, -1613, 75.36}, {-1010, -1613, 75.367}, {-1006, -1613, 75.36}, {-1002, -1613, 75.36}, {-998, -1613, 75.36}, {-994, -1613, 75.36}, {-990, -1613, 75.36}, {-1014, -1617, 75.36}, {-1010, -1617, 75.367}, {-1006, -1617, 75.36}, {-1002, -1617, 75.36}, {-998, -1617, 75.36}, {-994, -1617, 75.36}, {-990, -1617, 75.36}, {-1014, -1621, 75.36}, {-1010, -1621, 75.367}, {-1006, -1621, 75.36}, {-1002, -1621, 75.36}, {-998, -1621, 75.36}, {-994, -1621, 75.36}, {-990, -1621, 75.36}, } plant = {} colP = {} for i, v in ipairs (plantas) do plant[i] = createObject(3409, v[1],v[2],v[3]) colP[i] = createMarker(v[1],v[2],v[3],"cylinder",2.5,0,0,0,0) end function fcm1 () for i, col in ipairs (colP) do if isElementWithinMarker (localPlayer, col) then setPedAnimation (localPlayer, "INT_HOUSE", "wash_up", 10000, true, false, true, false, 10) setTimer(function () setPedAnimation (localPlayer) givePlayerMoney (math.random (500, 1000)) destroyElement (plant[i]) plant[i] = nil destroyElement (colP[i]) colP[i] = nil end, 10000, 1) break end end end addCommandHandler ("colher", fcm1) Outro problema que percebi, é que você estava criando as plantas na mesma variável da table plantas.
    1 point
  4. No seu lugar eu evitaria de mexer no painel admin para não correr risco de ficar sem o painel Admin e destruir o servidor. Em vez disso você pode simplesmente desativar as funções de dar armas e veículos para todos os Staffs por meio da ACL Group e pegar somente com o Freeroam. Dai nas settings do Freeroam você pode bloquear os veículos e armas que não podem ser usados por ID. Se você não estiver usando o Freeroam, crie outro painel específico apenas para dar veículos e armas. Pode ser um painel bem simples onde o usuário digita o ID da arma ou veículo em um editbox e clica em um botão. Dai ao clicar o botão, verifica se o ID está numa table personalizada que você criou (table de armas/veículos permitidos), se não estiver, nada acontece. Se estiver, dá a arma ou veículo pro usuário. Mas caso você realmente queira arriscar, saiba que o painel admin coloca as armas e veículos no painel preenchendo de maneira automática com loop passando pelos IDs. Ele não preenche por meio de arquivo XML como os interiores. Ele faz isso no arquivo client/gui/admin_main.Lua. Mais ou menos na linha 122 (naquele for) e mais ou menos na linha 142 (também um loop for).
    1 point
  5. Nothing changed with that extra line I think. But thanks @IIYAMA
    1 point
  6. Yes, but its not a problem for me cuz only happen if player is attach to vehicle in movement or if u aim fast with mouse
    1 point
  7. Main page Animation Homepage
    1 point
  8. Yeah, i read. i just didnt understand you dont need be ignorant. The resource that u mean doesnt attach the object to back, its attach the weapon model to back ( ex 356,355,etc ) not the objets like your ak[player]
    1 point
  9. Neste caso, para otimizar daria pra fazer ele simplesmente cancelar tudo antes da parte que interessa, dessa forma: function onWasted (totalAmmo, killer, killerWeapon, bodypart, stealth) local ContaDoPlayer = getPlayerAccount (source) if (isGuestAccount (ContaDoPlayer)) then return end -- Se for guest, cancela a função e não passa daqui. local theWeapon = getPedWeapon (source) local weaponAmmo = getPedTotalAmmo (source) takeAllWeapons (source) setPlayerWantedLevel (source, 0) setTimer (spawnPlayer, 1000, 1, source, 1158.344, -1293.679, 16.445, 0, getElementModel (source), 0, 0, getPlayerTeam(source)) fadeCamera (source, false, 0, 0, 0, 0) setTimer (fadeCamera, 2000, 1, source , true, 0.5) setTimer (setCameraTarget, 1250, 1, source) end addEventHandler ("onPlayerWasted", root, onWasted)
    1 point
  10. @kevincouto6 Vc interpretou errado. Você deve ter ouvido "evite condição de negação no if" isto é, evitar quando possível. Neste caso isolado, a diferença de processamento é irrelevante. Você deve manter do jeito que estava. Por exemplo: function isEvenNumber (thePlayer, cmd, number) local number = tonumber (number) local par = number/2 if (math.floor (par) == par) then outputChatBox ("Número par.", thePlayer) elseif not (math.floor (par) == par) then -- Poderia ser somente else, ou então usar ~= (diferente de) no lugar do == (igual a) outputChatBox ("Número ímpar.", thePlayer) end end addCommandHandler ("par", isEvenNumber)
    1 point
  11. function onWasted(totalAmmo, killer, killerWeapon, bodypart, stealth) local ContaDoPlayer = getPlayerAccount ( source ) if (isGuestAccount ( ContaDoPlayer ) then --deixe em branco else local theWeapon = getPedWeapon (source) local weaponAmmo = getPedTotalAmmo (source) takeAllWeapons(source) setPlayerWantedLevel(source, 0) setTimer (spawnPlayer, 1000, 1, source, 1158.344, -1293.679, 16.445, 0, getElementModel (source), 0, 0, getPlayerTeam(source)) fadeCamera ( source, false, 0, 0, 0, 0 ) setTimer ( fadeCamera, 2000, 1, source , true, 0.5 ) setTimer ( setCameraTarget, 1250, 1, source ) end end addEventHandler ("onPlayerWasted", getRootElement(), onWasted) Olá, costumo sempre pedir ajuda aqui, e em um dos meus posts, me recomendaram evitar o uso de if not, então use else assim quando não estiver, vai funcionar. Ouvi isso faz algum tempo espero que tenha ajudado. Alguem com mais experiência pode confirmar oq eu falei para ter certeza....
    1 point
  12. New forums released http://saegrpg.com/ Take a look
    1 point
×
×
  • Create New...