GrubaS Posted May 1, 2015 Share Posted May 1, 2015 Hello, I have problem its with 23 line. Look on ss, "AllowScreenUpload" cant check bcz bad argument Whats wrong? 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
ALw7sH Posted May 1, 2015 Share Posted May 1, 2015 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
GrubaS Posted May 1, 2015 Author Share Posted May 1, 2015 It's working Thanks guy for help! Thanks You Very Much Link to comment
GrubaS Posted May 4, 2015 Author Share Posted May 4, 2015 Hello again, I have problem as u can see on ss "test" i used guiSetText(spawnScreenMenu,getPlayerName(localPlayer)) why its showing my nick when i geting other players video? Link to comment
Walid Posted May 4, 2015 Share Posted May 4, 2015 Hello again,I have problem as u can see on ss "test" i used guiSetText(spawnScreenMenu,getPlayerName(localPlayer)) why its showing my nick when i geting other players video? post full code here Link to comment
GrubaS Posted May 4, 2015 Author Share Posted May 4, 2015 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
GrubaS Posted May 4, 2015 Author Share Posted May 4, 2015 I trying to make example: I have nick Nitro and i used command /getvideo Caddy and it's showing in gui but nick Nitro not his nick (Caddy) Link to comment
Walid Posted May 4, 2015 Share Posted May 4, 2015 I trying to make example: I have nick Nitro and i used command /getvideo Caddy and it's showing in gui but nick Nitro not his nick (Caddy) As far as i know you can't get the dx Status of an other player. Link to comment
GrubaS Posted May 4, 2015 Author Share Posted May 4, 2015 lol, can u open mta? i can show u if yes come server [G*M] Ganja Link to comment
Walid Posted May 4, 2015 Share Posted May 4, 2015 lol, can u open mta? i can show u if yes come server Ganja Mafia post screen shot here and as i told you can't. only your dx status. Link to comment
Walid Posted May 4, 2015 Share Posted May 4, 2015 as i can see it's the same dx status. Link to comment
GrubaS Posted May 4, 2015 Author Share Posted May 4, 2015 it's not the same?? how u know it?? If i can only max 1280 x 1024? Link to comment
Walid Posted May 4, 2015 Share Posted May 4, 2015 i'm pretty sure that there is somethig wrong in your code , post full code here (server;client) side. Link to comment
GrubaS Posted May 4, 2015 Author Share Posted May 4, 2015 (edited) it's working Edited May 4, 2015 by Guest Link to comment
Walid Posted May 4, 2015 Share Posted May 4, 2015 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
GrubaS Posted May 4, 2015 Author Share Posted May 4, 2015 still dont working client.lua.46 Bad Argument @ 'guiSetText' [Expected string at argument 2, got boolean] client.lua.46 Bad Argument @ 'getPlayerName' [Expected string at argument 1, got nil] Link to comment
Walid Posted May 4, 2015 Share Posted May 4, 2015 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
GrubaS Posted May 4, 2015 Author Share Posted May 4, 2015 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now