Jump to content

Blaawee

Members
  • Posts

    857
  • Joined

  • Last visited

Posts posted by Blaawee

  1. seems like you not visiting the wiki. guiGridListAddRow got only one arg which is the gui element. and one more thing!

    ATTENTION: Without guiGridListSetItemText there is no row added to the grid. Look at the example, first you give the row a name with row = guiGridListAddRow ( playerList ), and then you use guiGridListSetItemText.

  2. Room icons are mine, for instance. Please remove.

    i found that images on the internet,hard to believe you made it. i will remove it if you can prove you made it.

    Actually, It's belongs to Empire Of Riders "ER" which Gallardo9944 own that server. i've been playing in that server.

  3. here you go... IT'S IN CLIENT SIDE!
    addEventHandler("onClientRender", root, 
        function()    
         dxDrawText(""..getStaffOnDuty(), 449, 333, 921, 402, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false) 
                end 
    ) 
      
    function getStaffOnDuty() 
      theTableMembersOnline = "" 
      for i, player in ipairs(getElementsByType ( "player" )) do 
            if hasObjectPermissionTo(player, "function.kickPlayer", true) then 
          theTableMembersOnline = theTableMembersOnline .. ", " .. getPlayerName(player) 
            end 
        end 
      if theTableMembersOnline == "" then 
        return "" 
      else 
        return "Admins Online: " .. theTableMembersOnline 
      end 
    end 
      
    

    Are you kidding with me?? hasObjectPermissionTo is a client??

    It works, thank you very much... :D

    Which one is worked??

  4. Client:

    local gAdminTable = { }; 
      
    addEvent( "getAdminTabel", true ); 
    addEventHandler ( "getAdminTabel", root, 
        function( table ) 
            if table and type( table ) == 'table' then 
                gAdminTable = table; 
            else 
                error( 'No table.'); 
            end 
        end 
    ); 
      
    addEventHandler ( "onClientRender", root, 
        function( ) 
            local index = 0 
            for admins in pairs( gAdminTable ) do 
                if admins and getElementType( admins ) == 'player' then 
                    local color = tocolor( getPlayerNametagColor ( admins ) ); 
                    dxDrawAdminsLabel ( admins, index, color ); 
                    index = index + 1; 
                end 
            end 
        end 
    ); 
      
    function dxDrawAdminsLabel ( player, index, color ) 
        local sx, sy = guiGetScreenSize ( ) 
        local px, py = sx - 200, sy * 0.4 + 20 * sy / sy * index 
        dxDrawText ( getPlayerName ( player ):gsub('#%x%x%x%x%x%x', ''), px + 1, py + 1, px, py, tocolor ( 10, 10, 10, 255 ), sy / sy, 'default-bold', 'left', 'top', false, false, true, true, false ) 
        dxDrawText ( getPlayerName ( player ), px, py, px, py, color, sy / sy, 'default-bold', 'left', 'top', false, false, true, true, false ) 
    end 
    

    Server:

    local adminTable = { }; 
      
    function isPlayerAdmin ( player ) 
        if player and isElement( player ) and getElementType( player ) == 'player' then 
            for _, aclGroup in ipairs ( { 'Admin', 'Moderator', 'SuperModerator' } ) do 
                if isObjectInACLGroup ( "user." ..getAccountName( getPlayerAccount( player ) ) , aclGetGroup ( aclGroup ) ) then 
                    return true 
                else  
                    return false 
                end 
            end 
        end 
    end 
      
    function updateOnlineAdmin ( ) 
        triggerClientEvent( 'getAdminTabel', root, adminTable ); 
    end 
      
    addEventHandler( 'onPlayerLogin', root, 
        function( ) 
            if isPlayerAdmin( source ) then 
                if adminTable[ source ] then 
                    adminTable[ source ] = nil; 
                end 
                adminTable[ source ] = true; 
                updateOnlineAdmin( ); 
            end 
        end 
    ); 
      
    addEventHandler ( 'onPlayerLogout',  root, 
        function( ) 
            if adminTable[ source ] then 
                adminTable[ source ] = nil; 
            end 
            updateOnlineAdmin( ); 
        end 
    ); 
      
    addEventHandler ( "onPlayerQuit", root, 
        function( ) 
            if adminTable[ source ] then 
                adminTable[ source ] = nil; 
            end 
            updateOnlineAdmin( ); 
        end 
    ); 
    

  5. Test

    Test

    Test

    Try this:

    Remember To Use my .FX file.

    function dxDrawText3D( text, left, top, right, bottom, color, scale, font, rotX, rotY, rotZ, rotOfX, rotOfY, rotOfZ, alignX, alignY, clip, wordBreak, postGUI, colorCoded ) 
         
        if not text or not left or not top then 
            return; 
        end 
         
        local right = right or 0; 
        local bottom = bottom or 0; 
        local color = color or tocolor( 255, 255, 255, 255 ); 
        local scale = scale or 1; 
        local font = font or "default"; 
        local rotX = rotX or 0; 
        local rotY = rotY or 0; 
        local rotZ = rotZ or 0; 
        local rotOfX = rotOfX or 0; 
        local rotOfY = rotOfY or 0; 
        local rotOfZ = rotOfZ or 0; 
        local alignX = alignX or "left"; 
        local alignY = alignY or "top"; 
        local clip = clip or false; 
        local wordBreak = wordBreak or false; 
        local postGUI = postGUI or false; 
        local colorCoded = colorCoded or true; 
         
        local textWidth = dxGetTextWidth( text, scale, font ); 
        local fontHeight = dxGetFontHeight( scale, font ); 
         
        local drawSurface = dxCreateRenderTarget( textWidth, fontHeight, true ); 
         
        if not drawSurface then 
            return; 
        end 
         
        if not texShader then 
            return; 
        end 
         
        dxSetShaderValue( texShader, 'threeDimTex', drawSurface ) 
         
      
        dxSetRenderTarget( drawSurface ) 
            dxDrawText( text, 0, 0, textWidth, fontHeight, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded, true ) 
        dxSetRenderTarget( ) 
         
        dxSetShaderTransform( texShader, rotX, rotY, rotZ, rotOfX, rotOfY, rotOfZ ); 
         
        dxDrawImage( left, top, textWidth, fontHeight, texShader, 0, 0, 0, tocolor( 255, 255, 255, 255 ), postGUI ); 
       
        destroyElement( drawSurface ); 
    end 
    

  6. Sorry buddy.. I was kinda busy. About the resource.. i did tried it and it's working normal nothing stopped or anything! i think it's about your calculation? Maybe you did it wrong! Try this instead :

    local texShader = dxCreateShader('shared.fx'); 
    local imagee = "image.png"; 
    function dxDrawImage3D( posX, posY, width, height, image, rotX, rotY, rotZ, rotOfX, rotOfY, rotOfZ, color, postGUI ) 
          
        if not posX or not posY or not width or not height or not image then 
            return; 
        end 
            
        local rotX = rotX or 0; 
        local rotY = rotY or 0; 
        local rotZ = rotZ or 0; 
        local rotOfX = rotOfX or 0; 
        local rotOfY = rotOfY or 0; 
        local rotOfZ = rotOfZ or 0; 
        local color = color or tocolor( 255, 255, 255, 255 ); 
        local postGUI = postGUI or false; 
            
        local drawSurface = dxCreateRenderTarget( width, height, true ); -- Need to set the third arg to true to be created with an alpha channel. 
            
        if not drawSurface then 
            return; 
        end 
            
        if not texShader then 
            return; 
        end 
            
        dxSetShaderValue( texShader, 'threeDimTex', drawSurface ); 
             
        dxSetRenderTarget( drawSurface, true ); 
            dxDrawImage( 0, 0, width, height, image, 0, 0, 0, color ); 
        dxSetRenderTarget( ); 
             
        dxSetShaderTransform( texShader, rotX, rotY, rotZ, rotOfX, rotOfY, rotOfZ ); 
             
        dxDrawImage( posX, posY, width, height, texShader, 0, 0, 0, tocolor(255, 255, 255, 255), postGUI ); -- Draw the shader. 
             
        destroyElement( drawSurface ) 
    end 
      
    function testing1() 
        dxDrawImage3D( 250, 250, 500, 500, imagee, math.abs( getTickCount( )/20 ), 10, 30 )--,10,10,25,15,20,30,tocolor(255,255,255,255),true); 
    end; 
      
    addEventHandler("onClientRender",root,testing1); 
    

  7. Example

    i did create a new function for you.

    Remember to use this .FX File.

    3DPass.fx:

    // 
    // texPass.fx 
    // Author: Blaawee 
    // 
      
    texture threeDimTex;     
      
    technique tech 
    { 
        pass P0 
        { 
            Texture[0] = threeDimTex; 
        } 
    } 
      
    

    -- dxDrawImage3D( float posX, float posY, float width, float height, mixed image, float rotX, float rotY, float rotZ, float rotOfX, float rotOfY, float rotOfZ, int color, bool postGUI ) 
      
    local texShader = dxCreateShader('3DPass.fx'); 
    function dxDrawImage3D( posX, posY, width, height, image, rotX, rotY, rotZ, rotOfX, rotOfY, rotOfZ, color, postGUI ) 
      
        if not posX or not posY or not width or not height or not image then 
            return; 
        end 
         
        local rotX = rotX or 0; 
        local rotY = rotY or 0; 
        local rotZ = rotZ or 0; 
        local rotOfX = rotOfX or 0; 
        local rotOfY = rotOfY or 0; 
        local rotOfZ = rotOfZ or 0; 
        local color = color or tocolor( 255, 255, 255, 255 ); 
        local postGUI = postGUI or false; 
         
        local drawSurface = dxCreateRenderTarget( width, height, true ); -- Need to set the third arg to true to be created with an alpha channel.  
         
        if not drawSurface then 
            return; 
        end 
         
        if not texShader then 
            return; 
        end 
         
        dxSetShaderValue( texShader, 'threeDimTex', drawSurface ); 
        dxSetShaderTransform( texShader, rotX, rotY, rotZ, rotOfX, rotOfY, rotOfZ ); 
        dxSetRenderTarget( drawSurface ); 
        dxDrawImage( 0, 0, width, height, image, 0, 0, 0, color ); 
        dxSetRenderTarget( ); 
         
        dxDrawImage( posX, posY, width, height, texShader, 0, 0, 0, tocolor(255, 255, 255, 255), postGUI ); -- Draw the shader 
    end 
    

  8. Hmmm.. Why don't you get the text and set the text with the old one plus the new one??

    local oldText = guiGetText( gui-edit ); 
    local newText = guiSetText( gui-edit, oldText .. "1" ); 
    

×
×
  • Create New...