RdX Posted April 26, 2014 Share Posted April 26, 2014 hello guys my problem it's if u use any #rrggbb in your nick the money is visible if not use the money will be not visible without #rrggbb Colour with #rrggbb colour please help me and code in other post Link to comment
RdX Posted April 26, 2014 Author Share Posted April 26, 2014 this code label and money fuction ---------Client Side Moneystats = guiCreateLabel(200,120,150,16,"",false,statswin) guiSetFont(Moneystats,"default-bold-small") addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == gridOnlinePlayers ) then local select = guiGridListGetItemText ( source, guiGridListGetSelectedItem ( source ), 1 ); if ( select and select ~= "" ) then triggerServerEvent ( "getMoney", localPlayer, select ); end end end ); addEvent ( "SetMoneyInLabel", true ); addEventHandler ( "SetMoneyInLabel", root, function ( money ) guiSetText ( Moneystats, "Money : " .. money ); end ); -------Server Side addEvent ( "getMoney", true ); addEventHandler ( "getMoney", root, function ( select ) local gPlayer = getPlayerFromName ( select); if gPlayer == false then return end local pMoney = getPlayerMoney ( gPlayer ); triggerClientEvent ( source, "SetMoneyInLabel", source, pMoney ); end ); Link to comment
RdX Posted April 26, 2014 Author Share Posted April 26, 2014 show player in gridlist -----client side---- gridOnlinePlayers = guiCreateGridList(20,90,172,280,false,statswin) guiGridListSetSortingEnabled(gridOnlinePlayers, false) column = guiGridListAddColumn(gridOnlinePlayers,"Name",0.9) for _,player in ipairs(getElementsByType("player")) do local row = guiGridListAddRow (gridOnlinePlayers) guiGridListSetItemText(gridOnlinePlayers,row,1,string.gsub(getPlayerName(player), "#%x%x%x%x%x%x", ""),false,false) end Link to comment
AboShanab Posted April 26, 2014 Share Posted April 26, 2014 -- Show Player In GridList gridOnlinePlayers = guiCreateGridList(20,90,172,280,false,statswin) guiGridListSetSortingEnabled(gridOnlinePlayers, false) column = guiGridListAddColumn(gridOnlinePlayers,"Name",0.9) for _,player in ipairs(getElementsByType("player")) do local row = guiGridListAddRow (gridOnlinePlayers) guiGridListSetItemText(gridOnlinePlayers,row,1,string.gsub(getPlayerName(player), "#%x%x%x%x%x%x", ""),false,false) guiGridListSetItemData(gridOnlinePlayers,row,1,getPlayerName(player)) end -- On Click addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == gridOnlinePlayers ) then local select = guiGridListGetItemData ( source, guiGridListGetSelectedItem ( source ), 1 ); if ( select and select ~= "" ) then triggerServerEvent ( "getMoney", localPlayer, select ); end end end ); 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