iFoReX Posted July 14, 2012 Share Posted July 14, 2012 how I can fix this problem ? getPlayerAccount( a nil value) line 75 client-side sv addCommandHandler("csystem", function (thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "jefeBKZ" ) ) then triggerClientEvent(thePlayer,"abrir:It",thePlayer) end end ) cl GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(0.2225,0.03,0.535,0.9333,"GUI Clan System.",true) GUIEditor_Button[1] = guiCreateButton(17,96,121,38,"Agregar Miembro",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(17,140,121,42,"Remover Miembro",false,GUIEditor_Window[1]) GUIEditor_Grid[1] = guiCreateGridList(16,241,120,307,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) all = guiGridListAddColumn(GUIEditor_Grid[1],"Jugadores",0.2) GUIEditor_Grid[2] = guiCreateGridList(144,52,275,499,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[2],2) bkzC = guiGridListAddColumn(GUIEditor_Grid[2],"Miembros del Clan",0.7) guiGridListAddColumn(GUIEditor_Grid[2],"Rango",0.2) GUIEditor_Button[3] = guiCreateButton(17,52,121,38,"Agregar Jefe",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(17,188,121,42,"Darle Rango",false,GUIEditor_Window[1]) GUIEditor_Window[2] = guiCreateWindow(0.3237,0.215,0.4487,0.5183,"Rank GUI",true) GUIEditor_Grid[3] = guiCreateGridList(9,22,218,280,false,GUIEditor_Window[2]) guiGridListSetSelectionMode(GUIEditor_Grid[3],2) guiGridListAddColumn(GUIEditor_Grid[3],"Rangos",0.2) GUIEditor_Button[5] = guiCreateButton(233,27,117,48,"Darle Rango !",false,GUIEditor_Window[2]) GUIEditor_Button[6] = guiCreateButton(233,255,117,45,"Cancelar",false,GUIEditor_Window[2]) guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],false) showCursor(false) addEvent("abrir:It",true) addEventHandler("abrir:It",root,function() guiSetVisible(GUIEditor_Window[1], not guiGetVisible(GUIEditor_Window[1])) showCursor(guiGetVisible(GUIEditor_Window[1])) guiSetVisible(GUIEditor_Window[2],false) end ) function addPlayers() local limpiada = guiGridListClear(GUIEditor_Grid[1]) if ( limpiada ) then for index,player in ipairs ( getElementsByType("player") ) do local row = guiGridListAddRow(GUIEditor_Grid[1]) guiGridListSetItemText( GUIEditor_Grid[1], row, all, getPlayerName( player ), false, false) end end end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),addPlayers) addEventHandler("onClientPlayerJoin",root,addPlayers) addEventHandler("onClientPlayerQuit",root,addPlayers) addEventHandler("onClientPlayerChangeNick",root,addPlayers) function addBKZ() local limpiada = guiGridListClear(GUIEditor_Grid[2]) if ( limpiada ) then local BKZP = getOnlineBKZs() if #BKZP ~= 0 then for k,v in ipairs ( BKZP ) do local row = guiGridListAddRow(GUIEditor_Grid[2]) guiGridListSetItemText( GUIEditor_Grid[2],row,bkzC,getPlayerName(v),false,false) end end end end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),addBKZ) addEventHandler("onClientPlayerJoin",root,addBKZ) addEventHandler("onClientPlayerQuit",root,addBKZ) addEventHandler("onClientPlayerChangeNick",root,addBKZ) function getOnlineBKZs() local t1 = {} for k,v in ipairs ( getElementsByType("player") ) do local acc = getPlayerAccount(v);if not acc or isGuestAccount(acc) then return end;local accName = getAccountName(acc) local isBKZ = isObjectInACLGroup("user."..accName,aclGetGroup("bkz")) if isBKZ == true then table.insert(t1,v) end return t1 end end Link to comment
Vision Posted July 14, 2012 Share Posted July 14, 2012 getPlayerAccount is server-side only Link to comment
iFoReX Posted July 14, 2012 Author Share Posted July 14, 2012 and now what is bad ? sv-side addCommandHandler("csystem", function (thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "jefeBKZ" ) ) then triggerClientEvent(thePlayer,"abrir:It",thePlayer) end end ) function getOnlineBKZs() local t1 = {} for k,v in ipairs ( getElementsByType("player") ) do local acc = getPlayerAccount(v);if not acc or isGuestAccount(acc) then return end;local accName = getAccountName(acc) local isBKZ = isObjectInACLGroup("user."..accName,aclGetGroup("bkz")) if isBKZ == true then table.insert(t1,v) end return t1 end end cl-side GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(0.2225,0.03,0.535,0.9333,"GUI Clan System.",true) GUIEditor_Button[1] = guiCreateButton(17,96,121,38,"Agregar Miembro",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(17,140,121,42,"Remover Miembro",false,GUIEditor_Window[1]) GUIEditor_Grid[1] = guiCreateGridList(16,241,120,307,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) all = guiGridListAddColumn(GUIEditor_Grid[1],"Jugadores",0.2) GUIEditor_Grid[2] = guiCreateGridList(144,52,275,499,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[2],2) bkzC = guiGridListAddColumn(GUIEditor_Grid[2],"Miembros del Clan",0.7) guiGridListAddColumn(GUIEditor_Grid[2],"Rango",0.2) GUIEditor_Button[3] = guiCreateButton(17,52,121,38,"Agregar Jefe",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(17,188,121,42,"Darle Rango",false,GUIEditor_Window[1]) GUIEditor_Window[2] = guiCreateWindow(0.3237,0.215,0.4487,0.5183,"Rank GUI",true) GUIEditor_Grid[3] = guiCreateGridList(9,22,218,280,false,GUIEditor_Window[2]) guiGridListSetSelectionMode(GUIEditor_Grid[3],2) guiGridListAddColumn(GUIEditor_Grid[3],"Rangos",0.2) GUIEditor_Button[5] = guiCreateButton(233,27,117,48,"Darle Rango !",false,GUIEditor_Window[2]) GUIEditor_Button[6] = guiCreateButton(233,255,117,45,"Cancelar",false,GUIEditor_Window[2]) guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],false) showCursor(false) addEvent("abrir:It",true) addEventHandler("abrir:It",root,function() guiSetVisible(GUIEditor_Window[1], not guiGetVisible(GUIEditor_Window[1])) showCursor(guiGetVisible(GUIEditor_Window[1])) guiSetVisible(GUIEditor_Window[2],false) end ) function addPlayers() local limpiada = guiGridListClear(GUIEditor_Grid[1]) if ( limpiada ) then for index,player in ipairs ( getElementsByType("player") ) do local row = guiGridListAddRow(GUIEditor_Grid[1]) guiGridListSetItemText( GUIEditor_Grid[1], row, all, getPlayerName( player ), false, false) end end end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),addPlayers) addEventHandler("onClientPlayerJoin",root,addPlayers) addEventHandler("onClientPlayerQuit",root,addPlayers) addEventHandler("onClientPlayerChangeNick",root,addPlayers) function addBKZ() local limpiada = guiGridListClear(GUIEditor_Grid[2]) if ( limpiada ) then local BKZP = getOnlineBKZs() if #BKZP ~= 0 then for k,v in ipairs ( BKZP ) do local row = guiGridListAddRow(GUIEditor_Grid[2]) guiGridListSetItemText( GUIEditor_Grid[2],row,bkzC,getPlayerName(v),false,false) end end end end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),addBKZ) addEventHandler("onClientPlayerJoin",root,addBKZ) addEventHandler("onClientPlayerQuit",root,addBKZ) addEventHandler("onClientPlayerChangeNick",root,addBKZ) Link to comment
Guest Guest4401 Posted July 14, 2012 Share Posted July 14, 2012 What error does it show now? Link to comment
iFoReX Posted July 14, 2012 Author Share Posted July 14, 2012 error : getOnlineBKZ( a nil value ) 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