Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Castillo

    Snake GUIs

    function clickHandler() executeCommandHandler("snake") end addEventHandler("onClientGUIClick",myButton,clickHandler,false)
  2. Si, con ese recurso deberias poder crear textos en 3D.
  3. Busca un recurso que se llama "3dt" o algo asi en la comunidad.
  4. Both would do the same job. We're not the same person, we have different scripting ways, I guess you don't understand that.
  5. And what would fix? it will always return true, because what I'd is set "playerAccount" variable with the previous account argument.
  6. Es verdad, puse que cuando presiones el boton aparezca el cursor , copia el codigo de nuevo, ahora deberia mostrarlo al crear la GUI y al presionar el boton ocultarlo.
  7. TAPL, as far as I remember, someone suggested this some time ago, I really doubt people would listen to the rules. Could give it a try though .
  8. When a player logs out, getPlayerAccount will return as "Guest", you have to use the "previous account" argument, that's what I've changed. if (account and type(account) == "string") then playerAccount = getPlayerAccount( source ) elseif (type(account) == "userdata") then playerAccount = account end
  9. Yo diria que el bindKey lo creara en el server side y use triggerClientEvent, seria mas facil creo .
  10. ElMota: Copia mi codigo de nuevo, ahi funciona, me parecia que no se podia usar simplemente la funcion para ocultar un GUI.
  11. function changeTheSkin( source ) local playerAccount = getPlayerAccount( source ) if playerAccount and not isGuestAccount( playerAccount ) then for i = 0,17 do local arg1,arg2 = getPedClothes( source, i ) setAccountData( playerAccount, "player.clothes."..tostring( i ),tostring( arg1 )..","..tostring( arg2 ) ) end setAccountData( playerAccount, "player.skin", getElementModel( source ) ) outputChatBox("#FF0000*INFO: #0095FFYour skin was successfully saved!", source, 0, 255, 0, true) end end function fLogout (account) if (account and type(account) == "string") then playerAccount = getPlayerAccount( source ) elseif (type(account) == "userdata") then playerAccount = account end if playerAccount then local playerMoney = getPlayerMoney( source ) --local nSkin = getElementModel( source ) setAccountData( playerAccount, "player.money", playerMoney ) --setAccountData( playerAccount, "player.skin", nSkin ) for i = 1,12 do setAccountData ( playerAccount, "player.weaponID" .. tostring( i ), getPedWeapon ( source, i ) ) setAccountData ( playerAccount, "player.weaponAmmo" .. tostring( i ), getPedTotalAmmo ( source, i ) ) end end end addEventHandler( 'onPlayerLogout', root, fLogout ) addEventHandler( 'onPlayerQuit', root, fLogout ) addCommandHandler( "skinsave", changeTheSkin ) addEventHandler( "onPlayerWasted", root, function( ) local playerAccount = getPlayerAccount( source ) if playerAccount then local playerSkin = getAccountData( playerAccount, "player.skin" ) if playerSkin then spawnPlayer( 2155, -99, 3, 0, math.random( 0, 258 ),tonumber( playerSkin ) ) else spawnPlayer( 2155, -99, 3, 0, math.random( 0, 258 ) ) end end end ) addEventHandler( "onPlayerLogin", root, function( ) local playerAccount = getPlayerAccount( source ) if playerAccount then for i = 1,12 do local nWeapon = getAccountData ( playerAccount, "player.weaponID" ..tostring( i ) ) local nAmmo = getAccountData ( playerAccount, "player.weaponAmmo" ..tostring( i ) ) giveWeapon( source, tonumber( nWeapon ), tonumber( nAmmo ), tonumber ( nWeapon ) == 1 ) end local playerMoney = getAccountData( playerAccount, "player.money" ) setPlayerMoney( source, playerMoney ) local playerSkin = getAccountData( playerAccount, "player.skin" ) if playerSkin then setElementModel( source, playerSkin ) for i = 0,17 do local acc = getAccountData( playerAccount, 'player.clothes.'..i ) if not acc:find 'false' then addPedClothes( source,acc:sub( 1,acc:find( ',' ) - 1 ),acc:sub( acc:find( ',' ) + 1,acc:len( ) ),i ) end end end end end ) I've tested it and works, it saves on quit and logout.
  12. addEventHandler("onClientResourceStart",resourceRoot, function () GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(171,63,513,522,"Best Killer Of Zombies Clan",false) GUIEditor_Image[1] = guiCreateStaticImage(0.0214,0.0881,0.9513,0.1341,"shruk.png",true,GUIEditor_Window[1]) GUIEditor_Memo[1] = guiCreateMemo(0.0273,0.2893,0.9571,0.59,"mmm... Bueno esto es lo mas importante ..\n\n1. Reglas :\n\n .- No usar cheats ni bugs ( Razon de Bann o kick )\n .- No Abusar de admin ( Solo para admins )\n .- No Pedir por admin ya que el admin se gana no se pide\n .- No Pedir ser del clan ya que por lo menos ai q tener 700 kills para entrar al clan...\n2. Informacion :\n\n .- Bueeno cualquier Duda Consultenmelo a mi ElMota\n .- Si tienes un clan y quieres aserle un spawn solo pidemelo a mi pero por lo menos deben aver 2 miembros Activos\n\n3. Miembros del clan BKZ| :\n\n .-ElMota\n .-Roro\n .-Fernanda\n .-Wazon\n .-Dani\n .-D4niel\n .-Dash\n .-Gabi\n .-Cony\n .-Mati\n .-Vish0ow",true,GUIEditor_Window[1]) guiMemoSetReadOnly(GUIEditor_Memo[1],true) GUIEditor_Button[1] = guiCreateButton(0.6745,0.9023,0.2982,0.0747,"Cerrar",true,GUIEditor_Window[1]) addEventHandler("onClientGUIClick", GUIEditor_Button[1], function () guiSetVisible(GUIEditor_Window[1], false) showCursor(false) end,false) showCursor(true) end ) El problema principal era que el boton estaba dentro del evento, y el evento tambien tenia que estar dentro.
  13. Skin mods: https://community.multitheftauto.com/index.php?p= ... ls&id=3914 https://community.multitheftauto.com/index.php?p= ... ls&id=3915
  14. bindKey playSound3D Que yo sepa no necesitas nada mas.
  15. You could use onPlayerQuit and make a timer to see if player joins after some seconds.
  16. I doubt if it's possible, I tried onPlayerCommand and nothing, I guess MTA native commands doesn't trigger this event.
  17. Castillo

    question

    As I told you, you can't know who set the health of the player.
  18. Castillo

    question

    Copy my script again, I've fixed a bug. And about your question, no, you can't know who changed the player health.
  19. Castillo

    question

    Ok, now I understand. -- client side: local oldHealth = getElementHealth(localPlayer) function checkPlayerHealth() local currentHealth = getElementHealth(localPlayer) if (currentHealth ~= oldHealth) then if (oldHealth < currentHealth) then triggerServerEvent("onPlayerHealthChanged",localPlayer,oldHealth,currentHealth) end oldHealth = currentHealth end end addEventHandler("onClientPreRender",root,checkPlayerHealth) -- server side: addEvent("onPlayerHealthChanged",true) addEventHandler("onPlayerHealthChanged",root, function (old, new) outputChatBox(getPlayerName(source) .." has set his health from ".. old .." to ".. new .." he cheated on the map!",root,255,0,0) end )
  20. Castillo

    question

    I still don't understand, we gave you a script to give health, what else do you want?
  21. Castillo

    question

    Because that makes no sense, what do you want to do? you want to give all players X amount of health when the resource starts or what? you really should learn English.
  22. Castillo

    question

    You want it to be a function? not a command? function giveHealth(thePlayer, who, health) local accountName = getAccountName(getPlayerAccount(thePlayer)) if ( isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Admin" ) ) ) then local health = tonumber(health) local player = getPlayerFromName(who) if (health and player) then outputChatBox(getPlayerName(thePlayer) .." Has given ".. getPlayerName(player) .." ".. health .."% of health.",root,255,255,0) end end end
  23. Castillo

    question

    You're welcome then.
  24. Castillo

    question

    addCommandHandler("givehealth", function (thePlayer, cmd, who, health) local accountName = getAccountName(getPlayerAccount(thePlayer)) if ( isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Admin" ) ) ) then local health = tonumber(health) local player = getPlayerFromName(who) if (health and player) then setElementHealth(player, getElementHealth(player)+health) outputChatBox(getPlayerName(thePlayer) .." has given ".. getPlayerName(player) .." ".. health .."% of health.",root,0,255,0) end end end ) Do you mean that? /givehealth
  25. Maybe because it's a beta build?
×
×
  • Create New...