Jump to content

Seba500PLK

Members
  • Posts

    239
  • Joined

  • Last visited

Everything posted by Seba500PLK

  1. Now there is nothing in the gridlist
  2. What did I do wrong? --Client function gridacc (acc) --Create the grid list element --local playerList = guiCreateGridList ( 0.80, 0.10, 0.15, 0.60, true ) --Create a players column in the list local column = guiGridListAddColumn( accountGrid, "Player", 0.85 ) if ( column ) then --If the column has been created, fill it with players for id, player in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( accountGrid ) guiGridListSetItemText ( accountGrid, row, column, acc( player ), false, false ) end end end addEventHandler ( "onClientResourceStart", getResourceRootElement(), gridacc ) addEvent("updateGuis", true) addEventHandler("updateGuis", root, gridacc) --Server function update(client) local who = getPlayerFromName (client); local account = getPlayerAccount( who ); triggerClientEvent ( "updateGuis", getRootElement(), getAccountName ( account ) ) end
  3. hi I know I need to use the trigger, but do not know how --Client local tab = {} local tabpanel = {} local label = {} local button = {} local edit = {} local player = localPlayer function gridlist() local screenWidth, screenHeight = guiGetScreenSize() window1 = guiCreateWindow(screenWidth * 0.24, screenHeight * 0.2, 771, 457, "TEST", false) guiWindowSetSizable(window1, false) guiSetVisible(window1,false) accountGrid = guiCreateGridList(9, 23, 249, 228, false, window1) guiGridListSetSelectionMode(accountGrid, 2) end addEventHandler("onClientResourceStart", resourceRoot, gridlist) addEventHandler("onClientResourceStart",resourceRoot, function() if not isElement(window1) then gridlist() end bindKey ( "F3", "down", openGui ) end ) function openGui() if not isElement(window1) then gridlist() end if not guiGetVisible(window1) then --stats() guiSetVisible ( window1, true ) showCursor(true) else guiSetVisible ( window1, false ) showCursor(false) end end function gridacc () --Create the grid list element --local playerList = guiCreateGridList ( 0.80, 0.10, 0.15, 0.60, true ) --Create a players column in the list local column = guiGridListAddColumn( accountGrid, "Player", 0.85 ) if ( column ) then --If the column has been created, fill it with players for id, player in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( accountGrid ) guiGridListSetItemText ( accountGrid, row, column, getPlayerName( player ), false, false ) end end end addEventHandler ( "onClientResourceStart", getResourceRootElement(), gridacc )
  4. thank you for everything, you have from me a huge plus
  5. ok I was able to. And now to give yourself the points you need to enter: setElementData(getPlayerFromName("NAME"),"p_money",3)
  6. like trying to do it is either "nil" or "0" help
  7. 7 line getAccountData(currentAccount, "p_money)) should getAccountData(currentAccount, "p_money"))
  8. do not know too much on the triggers. please could you help? I'm sorry that so much of the time it takes --Client function getPlayerMoney ( ) local m = tonumber ( getElementData ( localPlayer, "p_money" ) ) if ( not m ) then m = 0 setElementData ( localPlayer, "p_money", 0 ) end return m end function setPlayerMoney ( money ) return setElementData ( localPlayer, "p_money", money ) end function givePlayerMoney ( money ) local c = getPlayerMoney ( localPlayer ) return setPlayerMoney ( localPlayer, c + money ) end local screenWidth, screenHeight = guiGetScreenSize() addEventHandler ( "onClientRender", root, function ( ) dxDrawText ( "Twoje PP: "..tostring ( getPlayerMoney ( ) ), screenWidth * 0.509 / 2, screenHeight * 0.022, screenWidth * 0.5 / 2, screenHeight * 0, tocolor ( 0, 0, 0, 255), 1, "bankgothic", "left", "top", false, false, true, true) dxDrawText ( "#FFC000Twoje PP: #FF4000"..tostring ( getPlayerMoney ( ) ), screenWidth * 0.506 / 2, screenHeight * 0.02, screenWidth * 0.5 / 2, screenHeight * 0, tocolor ( 2, 2, 214, 255), 1, "bankgothic", "left", "top", false, false, true, true) end ) --Server function onLogin(previousAccount, currentAccount) if not getAccountData(currentAccount, "p_money") or not getAccountData(currentAccount, "p_money") == nil then setAccountData(currentAccount, "p_money", 0) end end addEventHandler("onPlayerLogin", root, onLogin) function getPlayerMoney ( player ) local m = false local gPlayerAccount = getPlayerAccount(player) if (gPlayerAccount ~= false) and (isGuestAccount(gPlayerAccount) == false) then m = tonumber ( getAccountData ( gPlayerAccount, "p_money" ) ) if ( not m ) then m = 0 setAccountData ( player, "p_money", 0 ) end end return m end function getpoints ( player, command) local gPlayerAccount = getPlayerAccount(player) outputChatBox(tostring(getAccountData ( gPlayerAccount, "p_money" ))) end addCommandHandler ( "getp", getpoints )
  9. ok, quit and join save my points, is another problem Check: http://imagizer.imageshack.us/v2/1920x1 ... Sk2UPU.png
  10. i add a check point function: function getpoints ( player, command) local gPlayerAccount = getPlayerAccount(player) outputChatBox(tostring(getAccountData ( gPlayerAccount, "p_money" ))) end addCommandHandler ( "getp", getpoints ) Check: http://imagizer.imageshack.us/v2/1920x1 ... fbPaXy.png
  11. like what, add yourself these points by P -> Resources -> Execute command -> setElementData (getPlayerFromName ("Seba500PLK"), "p_money", 1) it badly or well?
  12. player account logged and no Guest account.
  13. did not work --Server function onLogin( player) if not getAccountData(player, "p_money") or getAccountData(player, "p_money") == nil then setAccountData(player, "p_money", 0) end end addEventHandler("onPlayerLogin", root, onLogin) function getPlayerMoney ( player ) local m = false local gPlayerAccount = getPlayerAccount(player) if (gPlayerAccount ~= false) and (isGuestAccount(gPlayerAccount) == false) then m = tonumber ( getAccountData ( gPlayerAccount, "p_money" ) ) if ( not m ) then m = 0 setAccountData ( player, "p_money", 0 ) end end return m end
  14. i leave and join the sever reset points
  15. I'm sorry but I can not understand
  16. --Server function getPlayerMoney ( player ) local m = tonumber ( getAccountData ( player, "p_money" ) ) if ( not m ) then m = 0 setAccountData ( player, "p_money", 0 ) end return m end function setPlayerMoney ( player, money ) return setAccountData ( player, "p_money", money ) end function givePlayerMoney ( player, money ) local c = getPlayerMoney ( player ) return setPlayerMoney ( player, c + money ) end dont work, no saved
  17. ok, thank you. Then the proof, because now my hosting does not work: /
×
×
  • Create New...