Jump to content

lLinux

Members
  • Posts

    169
  • Joined

  • Last visited

Posts posted by lLinux

  1. Te sugiero utilizar la función de búsqueda de foro antes de hacer una pregunta.

    https://forum.multitheftauto.com/viewtopic.php?f=146&t=74079

    En ese Topic ya no se estan posteando tutoriales, ya que los hago yo pero los estaba pòsteando tomas...

    Pero gracias igualmente por tomar en cuenta mis tutoriales :)

    Aquí te dejo la pagina: http://scriptingmtasa.wordpress.com

    Aquí donde aviso cuando hago nuevos tutoriales: http://www.fb.com/ScriptingMTASA

  2. You must verify that the item that enters the market than the user.

    Use:

      
    addEventHandler("onClientMarkerHit", root, 
    function (hitPlayer, dimensionMatch) 
        if getElementType(hitPlayer) == "player" and (hitPlayer == localPlayer) then  
        --... 
        end      
    end) 
    

    Thus:

      
    -- 
    -- Bring up the job window if a player walks into a job marker. 
    -- 
    addEventHandler("onClientMarkerHit", root, 
        function (hitPlayer, dimensionMatch) 
         if getElementType(hitPlayer) == "player" and (hitPlayer == localPlayer) then -- Check the Element 
            -- If the player isn't flying... 
                if not getElementData(hitPlayer, "superman:flying") then 
                -- If the player isn't too far above the marker... 
                local px,py,px = getElementPosition(hitPlayer) 
                local mx,my,mz = getElementPosition(source) 
                
                if (px <= (mz + 5)) then 
                    local markType = getElementData(source, "markType") 
                    
                    if (markType == "jobnpc") and (getPedOccupiedVehicle(hitPlayer) == false) then 
                        local jobName = getElementData(source, "jobName") 
                        local playerJob = getTeamName(getPlayerTeam(hitPlayer)) 
                        
                        -- If the player doesn't already have this job, show the job window. 
                        if (playerJob ~= jobName) then 
                            showJobWindow(jobName) 
                        end 
                    end 
                end 
            end 
        end --END    
       end 
    ) 
    

  3. Es lo mismo que esta haciendo con el Color del Rectagle... solo que ponle createObject y destroyElement.

    PD: No es necesario que crees un boton normal y lo pongas encima del Dx.

      
    if isCursorShowing() then 
        sX, sY, _, _, _ = getCursorPosition() 
            if sX >= xxx and sX <= xxx+www and sY >= yyy and sY <= yyy+hhh then 
                color3 = tocolor(255, 255, 255, 150) 
                --createObject 
            else 
                color3 = tocolor(0, 0, 0, 210)  
                --destroyElement 
            end 
    end 
    

  4.   
    function getRanks() 
        for index, player in ipairs(getElementsByType("player")) do 
            local account = getPlayerAccount( player ) 
            
            if account and not isGuestAccount( account ) then 
                local accountName = getAccountName( account ); 
                if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Admin" ) ) then 
                    setAccountData(account, "RAdmin", "Si") 
                elseif isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "SuperModerator" ) ) then 
                    setAccountData(account, "RSmod", "Si") 
                elseif isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Moderator" ) ) then 
                    setAccountData(account, "RMod", "Si") 
                end 
            end 
        end 
    end 
      
    

    El argumento 1 de setAccountData es la cuenta, no el elemento.

    Y getAccountData tanto setAccountData son funciones del server-side, por ende no podrás utilizarlas en el client-side.

    Aaaa mierd* se me habia olvidado que eran server-side.

  5. Mi problema es que quiero hacer que obtenga todos los jugadores conectados... coja a los que son admin, smod, mod y les de un setAccountData... para en el client-side obtenerlos con getAccountData y organizarlos en una lista, por color.

    Server-side:

    function getRanks() 
        for index, player in ipairs(getElementsByType("player")) do 
            local account = getPlayerAccount( player ) 
             
            if account and not isGuestAccount( account ) then 
                local accountName = getAccountName( account ); 
                if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Admin" ) ) then 
                    setAccountData(player, "RAdmin", "Si") 
                elseif isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "SuperModerator" ) ) then 
                    setAccountData(player, "RSmod", "Si") 
                elseif isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Moderator" ) ) then 
                    setAccountData(player, "RMod", "Si") 
                end 
            end 
        end 
    end 
    

    Client-Side:

    function Actualizar() 
    guiGridListClear(LISTA) 
    for index, player in ipairs(getElementsByType("player")) do 
        FILA = guiGridListAddRow(LISTA) 
        guiGridListSetItemText ( LISTA, FILA, COLUMNA, (string.gsub ( getPlayerName(player), '#%x%x%x%x%x%x', '' ) or getPlayerName(player)), false, false) 
        guiGridListSetItemData ( LISTA, FILA, COLUMNA, getPlayerName(player)) 
        if (getElementData(player, "RAdmin")) then 
            guiGridListSetItemColor(LISTA, FILA, COLUMNA, 0, 0, 255) 
        elseif (getElementData(player, "RSmod")) then 
            guiGridListSetItemColor(LISTA, FILA, COLUMNA, 0, 255, 255) 
        elseif (getElementData(player, "RMod")) then 
            guiGridListSetItemColor(LISTA, FILA, COLUMNA, 255, 255, 0) 
        else 
            guiGridListSetItemColor(LISTA, FILA, COLUMNA, 255, 255, 255) 
        end 
    end 
    end 
    

    Asi como esta marca que el argumento 1 de setAccountData del server-side esta mal. No he logrado hacer que obtenga tampoco.

  6. Hola a todos, bueno lo que quiero hacer es crear un script que guarde los vehiculos. como lo debo hacer... no tengo idea si con base de datos o no... La verdad no se manejar nada de base de datos.

×
×
  • Create New...