HoLsTeN Posted May 7, 2012 Share Posted May 7, 2012 hi It's Me again what is good for gruop sys accountdata or SQL Which is better in terms of lag ? thank you Link to comment
-ffs-Sniper Posted May 7, 2012 Share Posted May 7, 2012 What exactly do you mean by "groups sys"? Which is better in terms of lag ? They are both using the registry.db (SQL) or internal.db (account data) to store the data. Since they are both using the SQLlite database engine there is no difference in terms of lag. However SQL has a lot more possibilities to manage/sort the data. Link to comment
HoLsTeN Posted May 7, 2012 Author Share Posted May 7, 2012 ok thank you i will try it Link to comment
HoLsTeN Posted May 8, 2012 Author Share Posted May 8, 2012 Back Guys Can any one see what is the ERORE ? --Client function findnamee() if source == GroupNameButton then GroupName = guiGetText(GroupNameEdit) triggerServerEvent("Make_Group", getLocalPlayer(), GroupName) end end addEventHandler("onClientGUIClick", getRootElement(), findnamee) --server function createSQLOnStart () executeSQLCreateTable ( "Groups", "Name , Owner, Admin, Members") end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()),createSQLOnStart ) function addInfoToSQL(GroupName) local sourcename = getAccountName(getPlayerAccount(source)) local Members = {} table.insert(Members, sourcename) result = executeSQLSelect ( "Groups", "Name", "Name = '" .. GroupName .. "'" ) if ( result == false ) then outputChatBox ( "This is your first time here! Welcome " .. sourcename .. "!", source ) executeSQLInsert ( "Groups", "'" .. GroupName .. "', '".. sourcename.."', 'none','Members'" ) else outputChatBox ( "Some One Use This Group Name !", source ,111,111,0 ) outputChatBox (result, source) outputChatBox (GroupName, source) end end addEvent( "Make_Group", true ) addEventHandler ( "Make_Group", getRootElement(), addInfoToSQL ) It is just say Some One Use This Group Name ! and i try with 1 mel name But it is just say Some One Use this group name any one help ? Link to comment
Castillo Posted May 8, 2012 Share Posted May 8, 2012 Try this: --server function createSQLOnStart ( ) executeSQLCreateTable ( "Groups", "Name STRING, Owner STRING, Admin STRING, Members INT") end addEventHandler ( "onResourceStart", resourceRoot, createSQLOnStart ) function addInfoToSQL ( GroupName ) local sourcename = getAccountName ( getPlayerAccount ( source ) ) local result = executeSQLSelect ( "Groups", "Name", "Name = '" .. GroupName .. "'" ) if ( result == false ) then outputChatBox ( "This is your first time here! Welcome ".. sourcename .."!", source ) executeSQLInsert ( "Groups", "'".. GroupName .."', '".. sourcename .."', 'none','1'" ) else outputChatBox ( "Some One Use This Group Name !", source, 111, 111, 0 ) outputChatBox ( tostring ( result ), source ) outputChatBox ( GroupName, source ) end end addEvent( "Make_Group", true ) addEventHandler ( "Make_Group", getRootElement(), addInfoToSQL ) Link to comment
Bssol Posted May 8, 2012 Share Posted May 8, 2012 outputChatBox ( tostring ( result ), source ) result is a table, you can't make it string. i think the correct way is: outputChatBox ( result[1].Owner, source ) you can change Owner to another one, if you want to get another value. Link to comment
Castillo Posted May 9, 2012 Share Posted May 9, 2012 I already know it's a table, but maybe he wanted to know what it returns, not a specified 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