Jump to content

Patrick

Moderators
  • Posts

    1,144
  • Joined

  • Last visited

  • Days Won

    44

Everything posted by Patrick

  1. Wrong language, moved to Portuguese scripting.
  2. if getElementData(source,"adminduty") >= 1 then outputChatBox("#32b3ef[ADMIN] " .. adminrang .. " " .. playerName .. " "..kieg.." mondja: " .. message, source, 255, 255, 255, true) exports['sas_freecamtv']:add(shownto, playerName .. " mondja: " .. message, source) else outputChatBox(playerName .. " "..kieg.." mondja: " .. message, source, 255, 255, 255, true) end
  3. Gondolom ahol megvannak adva az admin tag-ek. Ahol nem kell tag oda csak egy üres stringet hagysz (hogy ne írja, hogy "Player"), meg oda írod bele a színkódot is. Gondolom.
  4. Nem sourcePlayer, hanem csak source
  5. source a player elementje, nem a thePlayer
  6. Akkor a thePlayer nem a megfelelő játékos / olyan rangod van amihez nincs adminTitle beállítva / akármi. Több többet nem tudok mondani ennyiből.
  7. 'adminrang' értéke nil (és a nil-t nem tudod belefűzni a stringbe az outputChatBoxnál), tehát valószínűleg nem létezik a 'exports.sas_global:getPlayerAdminTitle' függvény (bár erről is kéne lennie egy errornak)
  8. Tippelgethetünk, hogy mi a gond, de milyen hibát ír a debugscript? Mert írnia kell, már csak a helytelenül használt elseif miatt is.
  9. Welcome @Matheus_Teteu! Please use only English in this section, I moved your thread to Portuguese scripting.
  10. Wrong language, moved to Portuguese section.
  11. Ohh.. yeah, probably. Then he asked in wrong place. Here they are: https://github.com/multitheftauto/mtasa-blue/blob/a0410c68945b6b3d9225c8c90af2bb6b1cda5eaa/Client/core/CNickGen.cpp
  12. Hi. You can enable it with setPlayerNametagShowing.
  13. There are several createBlips already. Please be more specific. Also I want to remind you, this is a scripting related topic, where you can ask for help about your OWN code. I'm sure this is not your code.
  14. Hmm.. that's a good question ?
  15. https://github.com/botder/mtasa-webradio
  16. De nada.
  17. https://wiki.multitheftauto.com/wiki/SetAmbientSoundEnabled
  18. https://wiki.multitheftauto.com/wiki/SetPedTargetingMarkerEnabled
  19. Patrick

    Hud problem

    Probably because getHealthColor function doesn't return a color if health > 100. Just remove '(health <= 100)' condition from the first IF. function getHealthColor(health) if (health > 0) then if (health > 50) then return {238, 71, 71} elseif (health <= 50) and (health > 25) then return {235, 52, 52} elseif (health <= 25) and (health > 0) then return {176, 24, 24} end else return {198, 195, 195} end end
  20. Wrong language, moved to Portuguese section.
  21. Welcome.
  22. Are you interested about how to calculate K/D? It's kills count / deaths count, a simple division... just make sure deaths count is not 0 because you can't divide by zero.
  23. Hi. When you check the element-data, here 'if getElementData(Planta, "Planta") == true then', you have to use source instead of Planta. On wiki, you can see source is the element that got clicked by the player. Because now, you only always check the last created object's element-data. Always make your variables local otherwise they become global variables, and most of times you don't want that... mostly on server-side. In your case, I see why you didn't make it local, but it's a bad practise. You can't store multiple players' carried objects in one single variable... so you have to store them in a table. Something like that: local objectCarries = {} -- store carryed objects in this table function PegarVaso( player ) local Px, Py, Pz = getElementPosition( player ) local Vaso = createObject( 2203, Px, Py, Pz ) objectCarries[player] = Vaso -- store: player carry this object setPedAnimation( player, "CARRY", "crry_prtial", 4.1, true, true, true ) exports.pAttach:attach(Vaso, player, 1.7, 0, 0.4, 0.4, 90, 0, 0 ) end addCommandHandler( "pegarvaso", PegarVaso ) function LargarVaso( player ) local Px, Py, Pz = getElementPosition( player ) setPedAnimation( player, "CARRY", "putdwn", 1.0, false, false, false, true ) setTimer(function() setPedAnimation( player ) if objectCarries[player] and isElement(objectCarries[player]) then -- is player carrying an object? destroyElement( objectCarries[player] ) -- yes... so destroy it objectCarries[player] = nil -- and don't forget to remove it from our table too end local Planta = createObject( 2203, Px , Py , Pz -0.85) setElementData( Planta, "Planta", true ) end, 1200, 1) end addCommandHandler( "soltarvaso", LargarVaso ) function Planta( button, state, player ) -- Add the function if button == "left" and state == "down" then if getElementData(source, "Planta") == true then triggerClientEvent( "MenuPlantar", player ) end end end addEventHandler( "onElementClicked", root, Planta ) ... and one more thing, source is a hidden variable what MTA define for you in most of times. Don't call your variables as source because you overwrite the hidden one... and can cause other problems.
  24. You can change door's rotation with setVehicleDoorOpenRatio. Also here is a resource.
  25. Patrick

    [HELP] F11 Map

    Welcome
×
×
  • Create New...