Jump to content

Help guys :/


Recommended Posts

Hello,

I have problem its with 23 line. Look on ss, "AllowScreenUpload" cant check bcz bad argument :x

Whats wrong?

mta-screen-2015-05-01-15-19-22.png

addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        spawnScreenMenu = guiCreateWindow(374, 93, 425, 415, "test", false) 
        guiWindowSetSizable(spawnScreenMenu, false) 
        guiSetProperty(spawnScreenMenu, "CaptionColour", "FFE2AC2A") 
        spawnScreenOKButton = guiCreateButton(10, 385, 50, 20, "Close", true, spawnScreenMenu) 
        guiSetFont(spawnScreenOKButton, "default-bold-small") 
  
        GUIEditor.label[1] = guiCreateLabel(305, 385, 100, 25, "by Chudy ©", false, spawnScreenMenu) 
        guiSetFont(GUIEditor.label[1], "clear-normal") 
        guiWindowSetMovable ( spawnScreenMenu, false ) 
        guiWindowSetSizable ( spawnScreenMenu, false ) 
        --------------------------------------------------------------------- 
        spawnScreenGridList = guiCreateGridList(10, 25, 405, 355, false, spawnScreenMenu) 
        guiGridListSetSelectionMode ( spawnScreenGridList, 2 )--ensure the selection mode is one per column 
        guiGridListAddColumn ( spawnScreenGridList, "Name", 0.5 ) 
        guiGridListAddColumn ( spawnScreenGridList, "Settings", 0.5 ) 
        local info = dxGetStatus() 
        for k, v in pairs( info ) do 
                --add a new row to our gridlist each time 
                local row = guiGridListAddRow ( spawnScreenGridList ) --get our new row 
                --next, we set that rows text to the weapon name.  Column is 1 since the "Shotguns" column was created first. 
                guiGridListSetItemText ( spawnScreenGridList, row, 2, v, false, false ) 
                guiGridListSetItemText ( spawnScreenGridList, row, 1, k, false, false ) 
                 
    end 
    row = 0 
end 
) 

Please Help,

Link to comment
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        spawnScreenMenu = guiCreateWindow(374, 93, 425, 415, "test", false) 
        guiWindowSetSizable(spawnScreenMenu, false) 
        guiSetProperty(spawnScreenMenu, "CaptionColour", "FFE2AC2A") 
        spawnScreenOKButton = guiCreateButton(10, 385, 50, 20, "Close", true, spawnScreenMenu) 
        guiSetFont(spawnScreenOKButton, "default-bold-small") 
  
        GUIEditor.label[1] = guiCreateLabel(305, 385, 100, 25, "by Chudy ©", false, spawnScreenMenu) 
        guiSetFont(GUIEditor.label[1], "clear-normal") 
        guiWindowSetMovable ( spawnScreenMenu, false ) 
        guiWindowSetSizable ( spawnScreenMenu, false ) 
        --------------------------------------------------------------------- 
        spawnScreenGridList = guiCreateGridList(10, 25, 405, 355, false, spawnScreenMenu) 
        guiGridListSetSelectionMode ( spawnScreenGridList, 2 )--ensure the selection mode is one per column 
        guiGridListAddColumn ( spawnScreenGridList, "Name", 0.5 ) 
        guiGridListAddColumn ( spawnScreenGridList, "Settings", 0.5 ) 
        local info = dxGetStatus() 
        for k, v in pairs( info ) do 
                --add a new row to our gridlist each time 
                local row = guiGridListAddRow ( spawnScreenGridList ) --get our new row 
                --next, we set that rows text to the weapon name.  Column is 1 since the "Shotguns" column was created first. 
                guiGridListSetItemText ( spawnScreenGridList, row, 2, tostring(v), false, false ) 
                guiGridListSetItemText ( spawnScreenGridList, row, 1, tostring(k), false, false ) 
                
    end 
    row = 0 
end 
) 

Link to comment
        spawnScreenMenu = guiCreateWindow(374, 93, 425, 415, "", false) 
        guiSetVisible(spawnScreenMenu, false) 
        guiWindowSetSizable(spawnScreenMenu, false) 
        guiSetProperty(spawnScreenMenu, "CaptionColour", "FFE2AC2A") 
         
        przycisk = guiCreateButton(10, 385, 50, 20, "Close", false, spawnScreenMenu) 
        guiSetFont(przycisk, "default-bold-small")   
         
  
        owner = guiCreateLabel(305, 385, 100, 25, "by Chudy ©", false, spawnScreenMenu) 
        guiSetFont(owner, "clear-normal") 
        guiWindowSetMovable ( spawnScreenMenu, true ) 
        guiWindowSetSizable ( spawnScreenMenu, false ) 
        spawnScreenGridList = guiCreateGridList(10, 25, 405, 355, false, spawnScreenMenu) 
        guiGridListSetSelectionMode ( spawnScreenGridList, 2 ) 
        guiGridListAddColumn ( spawnScreenGridList, "Name", 0.5 ) 
        guiGridListAddColumn ( spawnScreenGridList, "Settings", 0.5 ) 
         
addEvent("getResInfo", true) 
addEventHandler("getResInfo", resourceRoot, 
function()       
      
  
             
        --------------------------------------------------------------------- 
        local sw,sh = guiGetScreenSize() 
        local info = dxGetStatus() 
        table_info = {} 
        table_info1 = {} 
        guiSetText(spawnScreenMenu,getPlayerName(localPlayer)) 
        table.insert(table_info,{"Screen Width",sw}) 
        table.insert(table_info,{"Screen Height",sh}) 
        for i ,v in pairs (info ) do 
        table.insert(table_info,{i,v}) 
            end 
        triggerServerEvent("send:data",resourceRoot,table_info) 
  
end) 
  
  
addEvent("openWindow", true) 
addEventHandler("openWindow", resourceRoot, 
function(info)           
  
             guiGridListClear (spawnScreenGridList) 
            guiSetVisible ( spawnScreenMenu, not guiGetVisible ( spawnScreenMenu ) ) 
            showCursor ( guiGetVisible ( spawnScreenMenu ) ) 
            guiSetInputEnabled ( guiGetVisible ( spawnScreenMenu ) ) 
             
     
                for k, v in ipairs( info ) do 
                 
                local row = guiGridListAddRow ( spawnScreenGridList ) 
                guiGridListSetItemText ( spawnScreenGridList, row, 2,tostring(v[2]), false, false ) 
                guiGridListSetItemText ( spawnScreenGridList, row, 1, tostring(v[1]), false, false ) 
                 
                 
    end 
  
end) 

Link to comment

man i told you can't get the dx status of an other player .

anyways if you want to see his name just try this :

-- Server side

setTimer( function() triggerClientEvent(thePlayer,"openWindow",resourceRoot,data_table,pTarget) end,1000,1 ) 

-- Client side

addEvent("openWindow", true) 
addEventHandler("openWindow", resourceRoot, 
function(info,player)          
    guiGridListClear (spawnScreenGridList) 
    guiSetVisible ( spawnScreenMenu, not guiGetVisible ( spawnScreenMenu ) ) 
    showCursor ( guiGetVisible ( spawnScreenMenu ) ) 
    guiSetInputEnabled ( guiGetVisible ( spawnScreenMenu ) ) 
    guiSetText(spawnScreenMenu,getPlayerName(player)) 
    for k, v in ipairs( info ) do 
    local row = guiGridListAddRow ( spawnScreenGridList ) 
    guiGridListSetItemText ( spawnScreenGridList, row, 2,tostring(v[2]), false, false ) 
    guiGridListSetItemText ( spawnScreenGridList, row, 1, tostring(v[1]), false, false )                   
    end 
  
end) 

Link to comment

Man many things wrong in your code. more than that as i told you you can't get some one else dx status.

Anyways try this

Client :

addEventHandler( "onClientResourceStart", getRootElement( ), 
function() 
    spawnScreenMenu = guiCreateWindow(374, 93, 425, 415, "", false) 
    guiSetVisible(spawnScreenMenu, false) 
    guiWindowSetSizable(spawnScreenMenu, false) 
    guiSetProperty(spawnScreenMenu, "CaptionColour", "FFE2AC2A") 
    przycisk = guiCreateButton(10, 385, 50, 20, "Close", false, spawnScreenMenu) 
    guiSetFont(przycisk, "default-bold-small")   
    owner = guiCreateLabel(305, 385, 100, 25, "by Chudy ©", false, spawnScreenMenu) 
    guiSetFont(owner, "clear-normal") 
    guiWindowSetMovable ( spawnScreenMenu, true ) 
    guiWindowSetSizable ( spawnScreenMenu, false ) 
    spawnScreenGridList = guiCreateGridList(10, 25, 405, 355, false, spawnScreenMenu) 
    guiGridListSetSelectionMode ( spawnScreenGridList, 2 ) 
    guiGridListAddColumn ( spawnScreenGridList, "Name", 0.5 ) 
    guiGridListAddColumn ( spawnScreenGridList, "Settings", 0.5 ) 
end  
)       
  
  
addEvent("openWindow", true) 
addEventHandler("openWindow", root, 
function(player)          
    local info = dxGetStatus( ) 
    guiGridListClear (spawnScreenGridList) 
    guiSetVisible ( spawnScreenMenu, not guiGetVisible ( spawnScreenMenu ) ) 
    showCursor ( guiGetVisible ( spawnScreenMenu ) ) 
    guiSetInputEnabled ( guiGetVisible ( spawnScreenMenu ) ) 
    guiSetText(spawnScreenMenu,getPlayerName(player)) 
    for k, v in ipairs( info ) do 
    local row = guiGridListAddRow ( spawnScreenGridList ) 
    guiGridListSetItemText ( spawnScreenGridList, row, 1, k, false, false ) 
    guiGridListSetItemText ( spawnScreenGridList, row, 2,tostring( v ), false, false ) 
    end 
end) 
  
  
addEventHandler( "onClientGUIClick", root, 
function () 
    if source == przycisk then 
    guiSetVisible ( spawnScreenMenu, false ) 
    showCursor (false ) 
    guiSetInputEnabled ( true ) 
    end 
end) 

* Server side:

function komenda(thePlayer, cmd, theTarget) 
    if isElement(thePlayer) then  
        if theTarget then 
        local pTarget = findPlayer(theTarget) 
        if (isElement(pTarget)) then 
         triggerClientEvent(thePlayer,"openWindow",thePlayer,pTarget)  
        else 
            outputChatBox("No player matches with "..theTarget, thePlayer, 255, 0, 0) 
        end 
    else 
            outputChatBox("Syntax: /checkvideo ", thePlayer, 255, 100, 0, true) 
        end 
    end 
end  
addCommandHandler("cvideo",komenda) 
  
  
function findPlayer( player ) 
    if ( player and type( player ) == "string" ) then 
        local playerElement = getPlayerFromName( player ) 
        if ( playerElement ) then return playerElement end 
        local playersCounted = 0 
        local player = string.lower(player) 
        local spl = split( player, string.byte( "[" ) ) 
        if ( spl ) then 
            player = table.concat( spl, ";" ) 
        end 
        for k, v in pairs( getElementsByType( "player" ) ) do 
            local name = string.lower( getPlayerName( v ) ) 
            local spl = split( name, string.byte( "[" ) ) 
            if ( spl ) then 
                name = table.concat( spl, ";" ) 
            end 
            if ( string.find( name, player ) ) then 
                playerElement = v 
                playersCounted = playersCounted + 1 
            end 
        end 
        if ( playerElement and playersCounted == 1 ) then 
            return playerElement 
        end 
        return false 
    else 
        return false 
    end 
end 

Link to comment
man i told you can't get the dx status of an other player .

anyways if you want to see his name just try this :

-- Server side

setTimer( function() triggerClientEvent(thePlayer,"openWindow",resourceRoot,data_table,pTarget) end,1000,1 ) 

-- Client side

addEvent("openWindow", true) 
addEventHandler("openWindow", resourceRoot, 
function(info,player)          
    guiGridListClear (spawnScreenGridList) 
    guiSetVisible ( spawnScreenMenu, not guiGetVisible ( spawnScreenMenu ) ) 
    showCursor ( guiGetVisible ( spawnScreenMenu ) ) 
    guiSetInputEnabled ( guiGetVisible ( spawnScreenMenu ) ) 
    guiSetText(spawnScreenMenu,getPlayerName(player)) 
    for k, v in ipairs( info ) do 
    local row = guiGridListAddRow ( spawnScreenGridList ) 
    guiGridListSetItemText ( spawnScreenGridList, row, 2,tostring(v[2]), false, false ) 
    guiGridListSetItemText ( spawnScreenGridList, row, 1, tostring(v[1]), false, false )                   
    end 
  
end) 

it's working!!!! Thanks!

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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