Jump to content

help me!!


Sniiper

Recommended Posts

Posted

Hey i need help with my userpanel

when i activate my userpanel give me this errors:

ERROR: Client triggered serverside event onClientCallsServerFunction, but event is not added serverside

ERROR: Client triggered serverside event onClientLoaded, but event is not added serverside

plz help me thx

Posted

That mean's you got missing server side part.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Where did you get that "userpanel"? mind posting it here?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

friend give me, and sure

Draw_client:

-- Get relative scale based on input 
function getDxMenuScale(int)
    return (int*0.50)/1080
end
 
-- Set all required variables
local screenWidth, screenHeight = guiGetScreenSize()
 
local sizeX = 0
local sizeY = -screenHeight/10
local toSizeX = 0
local toSizeY = -screenHeight/10
 
local pixelSpeed = (screenWidth/1.5)/31
local increaseSpeedX = pixelSpeed
local increaseSpeedY = pixelSpeed
local fadeStageX = screenWidth/10
local fadeStageY = screenHeight/10
local fadeFactorX = (screenWidth/(getDxMenuScale(screenWidth)*1.768))/1000
local fadeFactorY = (screenHeight/(getDxMenuScale(screenHeight)*1.768))/1000
 
local imageWidth, imageHeight = 400 * getDxMenuScale(screenWidth), 200 * getDxMenuScale(screenWidth)
local imageLocationY = screenHeight - ((screenHeight/10)/2 + imageHeight/2)
local imageOffset = getDxMenuScale(screenWidth)*8
 
local increaseAlpha = 3
local dxImageAlpha = 0
local imageFade = false
local guiFade = false
local performingAnimation = false
 
local selectedMenu = 0
 
 
 
-- Specify the filepaths for the DX Menu images
dxImages = {
    "img/dxstats.png",
    "img/dxplayers.png",
    "img/dxachievements.png",
    "img/dxshop.png",
    "img/dxmaps.png",
    "img/dxoptions.png"
    }
 
dxImageHighlights = {
    "img/dxstatsh.png",
    "img/dxplayersh.png",
    "img/dxachievementsh.png",
    "img/dxshoph.png",
    "img/dxmapsh.png",
    "img/dxoptionsh.png"
    }
 
 
-- Relative coordinates for the seperate "buttons"
locA = 0.0328 * screenWidth
locB = 0.1477 * screenWidth
locC = 0.2883 * screenWidth
locD = 0.5063 * screenWidth
locE = 0.6273 * screenWidth
locF = 0.7414 * screenWidth
locG = 0.8805 * screenWidth
locHeight = screenHeight - screenHeight/10
 
 
 
-- On script start, add the event handlers and binds
function onDxDrawResourceStart()
    addEventHandler("onClientRender",getRootElement(),drawDxRectangle)
    addEventHandler("onClientRender",getRootElement(),drawDxImages)
    addEventHandler("onClientRender",getRootElement(),drawDxText)
    addEventHandler("onClientRender",getRootElement(),getUserMouseSelection)
    addEventHandler("onClientClick",getRootElement(),checkDxMenuSelection)
    showCursor(false)
    bindKey("U","down",openDxMenu)
end
addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),onDxDrawResourceStart)
 
 
-- Open the DX Menu
function openDxMenu()
    if not (performingAnimation) then
        if toSizeX == screenWidth then -- Close the menu
            toSizeX = 0
            toSizeY = -screenHeight/10
            toSizeTX = screenWidth
            toSizeTY = 0
            increaseSpeedX = pixelSpeed
            increaseSpeedY = pixelSpeed
            imageFade = false
            showCursor(false)
            displayTab(0)
        else -- Open the menu
            toSizeX = screenWidth
            toSizeY = -screenHeight/10
            toSizeTX = screenWidth
            toSizeTY = screenHeight/10
            increaseSpeedX = pixelSpeed
            increaseSpeedY = pixelSpeed
            imageFade = true
            showCursor(true)
        end
    end
end
 
 
-- When a player clicks, check if they clicked on one of the DX Menu buttons
function checkDxMenuSelection(button,state)
    if (button == "left") and (state == "down") then
        if selectedMenu ~= 0 then
            displayTab(selectedMenu)
        end
    end
end
 
 
-- Draw the images on the DX Menu
function drawDxImages()
    for iter,img in ipairs(dxImages) do
        dxImageAlpha = getDxImageAlpha()
 
        -- Draw the rectangle for the darkened background
        dxDrawRectangle(0,0,screenWidth,screenHeight,tocolor(0,0,0,dxImageAlpha/6))
 
        if iter < 3 then            -- Draw it normally
            dxDrawImage((imageOffset+imageWidth/1.5)*(iter-1),imageLocationY,imageWidth,imageHeight,dxImages[iter],0,0,0,tocolor(255,255,255,dxImageAlpha),true,true,true)
        elseif iter == 3 then       -- Add more space here
            dxDrawImage((imageOffset+imageWidth/1.25)*(iter-1),imageLocationY,imageWidth,imageHeight,dxImages[iter],0,0,0,tocolor(255,255,255,dxImageAlpha),true,true,true)
        elseif iter > 3 then        -- Draw normally again with some more distance
            dxDrawImage((imageOffset+imageWidth/1.6)*(iter),imageLocationY,imageWidth,imageHeight,dxImages[iter],0,0,0,tocolor(255,255,255,dxImageAlpha),true,true,true)
        end
    end
end
 
 
-- Draw the black DX Menu bar
function drawDxRectangle()
    local sizeX, sizeY = getDxBottomBarSize()
    local topBarAlpha = getDxImageAlpha() - 15
    local topEdgeAlpha = getDxImageAlpha() - 60
    if topBarAlpha < 0 then topBarAlpha = 0 end
    if topEdgeAlpha < 0 then topEdgeAlpha = 0 end
 
    -- Bottom bar
    dxDrawRectangle( 0, screenHeight, sizeX, sizeY, tocolor(0, 0, 0, 245),true,true,true)
    dxDrawRectangle( 0, screenHeight - (screenHeight/10 + 1), sizeX, 2.5, tocolor(40, 40, 40, 195),true,true,true)
 
    -- Top bar
    dxDrawRectangle( 0, 0, screenWidth, screenHeight/10, tocolor(0, 0, 0, topBarAlpha),true,true,true)
    dxDrawRectangle( 0, screenHeight/10 - 1, screenWidth, 2.5, tocolor(40, 40, 40, topEdgeAlpha),true,true,true)
end
 
 
-- Draw the text on the DX Menu
function drawDxText()
    local dxTextAlpha = getDxImageAlpha()
    local textOffsetX, textOffsetY = 0.0175 * screenWidth, 0.0175 * screenHeight
    local logoImageX,logoImageY = 450 * (getDxMenuScale(screenWidth)*1.5),100 * (getDxMenuScale(screenWidth)*1.5)
 
    -- Draw time and date
    dxDrawText(getServerTime()[2],textOffsetX,textOffsetY * 1.5,screenWidth,screenHeight,tocolor(255,160,0,dxTextAlpha),1.7*getDxMenuScale(screenWidth),"bankgothic","left","top",true,true,true)
    dxDrawText(getServerTime()[1],textOffsetX,textOffsetY * 2.7,screenWidth,screenHeight,tocolor(255,80,0,dxTextAlpha),1.7*getDxMenuScale(screenWidth),"bankgothic","left","top",true,true,true)
 
    -- Draw the logo image
    dxDrawImage(screenWidth - logoImageX,0 + getDxMenuScale(screenHeight)*10,logoImageX,logoImageY,"img/dxlogo.png",0,0,0,tocolor(255,255,255,dxTextAlpha),true,true,true)
end
 
 
 
 
--------------------------------------------------
 
 
 
 
 
-- Change the size of the bottom bar
function getDxBottomBarSize()
    if (sizeX == toSizeX and sizeY == toSizeY) then
        increaseSpeedX = pixelSpeed
        increaseSpeedY = pixelSpeed
        performingAnimation = false
        return sizeX,sizeY
    end
    if not (sizeX == toSizeX) then
        if sizeX > toSizeX then             -- Decrease X position
            if sizeX < toSizeX + fadeStageX then
                increaseSpeedX = increaseSpeedX / fadeFactorX
            end
            sizeX = sizeX - increaseSpeedX
            if sizeX <= toSizeX + 0.3 then
                sizeX = toSizeX
            end
        else                                -- Increase X position
            if sizeX > toSizeX - fadeStageX then
                increaseSpeedX = increaseSpeedX / fadeFactorX
                if increaseSpeedX <= 1 then
                    increaseSpeedX = 1
                end
            end
            sizeX = sizeX + increaseSpeedX
            if sizeX >= toSizeX - 0.3 then
                sizeX = toSizeX
            end
        end
        performingAnimation = true
    end
    if not (sizeY == toSizeY) then
        if sizeY < toSizeY then             -- Decrease Y position
            if sizeY > toSizeY - fadeStageY then
                increaseSpeedY = increaseSpeedY / fadeFactorY
            end
            sizeY = sizeY + increaseSpeedY
            if sizeY >= toSizeY - 0.3 then
                sizeY = toSizeY
            end
        else                                -- Increase Y position
            if sizeY < toSizeY + fadeStageY then
                increaseSpeedY = increaseSpeedY / fadeFactorY
            end
            sizeY = sizeY - increaseSpeedY
            if sizeY <= toSizeY + 0.3 then
                sizeY = toSizeY
            end
        end
        performingAnimation = true
    end
    return sizeX,sizeY
end
 
 
-- Change the size of the top bar
--[[
function getDxTopBarSize()
    if (sizeTX == toSizeTX and sizeTY == toSizeTY) then
        increaseSpeedTX = pixelSpeed/10
        increaseSpeedTY = pixelSpeed/10
        performingAnimation = false
        return sizeTX,sizeTY
    end
    if not (sizeTX == toSizeTX) then
        if sizeTX > toSizeTX then               -- Decrease X position
            if sizeTX < toSizeTX + fadeStageTX then
                increaseSpeedTX = increaseSpeedTX / fadeFactorTX
            end
            sizeTX = sizeTX - increaseSpeedTX
            if sizeTX <= toSizeTX + 0.3 then
                sizeTX = toSizeTX
            end
        else                                -- Increase X position
Posted

Well, I guess your "friend" stole it from downloaded client files.

You don't have the server side, right?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

That mean's that script is stolen, we don't help people who steals scripts.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

As I said: We don't help people who steals scripts.

You can check the MTA community for resources, there some userpanels for race.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...