Jump to content

MySQL database and ACL?


Recommended Posts

Posted

Hello again everyone I have another quick question. I have created a login system with a MySQL database (with the MySQL Plugin) and I was wondering how I could involve my ACL in it so I could still use the admin system....thanks guys

Posted

I think u gonna need to do a big job involving all... Also I recommend to use the sqlitedb included on mta, cause is too much easy to manage, and you don't need to use third-party resources...

Well, u gonna need to use MySQL to link the stats to a website?

Posted

@simstosh:

Personally, I would use MySQL even if I won't make stats on website or something - cause MySQL is more powerful, and I'm missing few features in SQLite, but tbh - for most users here SQLite should be enough.

Posted

@varez

Yeah, I haven't use MySQL on MTA, I think it his use is only on extreme cases (too much data for a server, or espcially for web use). On my case, i'm using the SQLite, cause is a simple server.

On SA-MP I do a fully integrated server/website, but SA-MP's MySQL plugin uses too much resources (memory leaks), so for SA-MP I don't recommend MySQL.

Posted

so how would I combine the two?

example?

function adminRights()
local thePlayer = getPlayerName(playerSource)
if (TAGS[player] == "4") then
aclGroupAddObject (aclGetGroup("Admin"), "user."..thePlayer)
end
end

Posted

well I am using cannons user system....and in the resource he uses classes like

class 2 = member

class 4 = admin

however it is all MySQL so what can I do do when I make an account class 4 it also goes into the acl so I can use lil toady admin panel?

Posted

You know the User System script in resources? Doesn't it use that?...

From UserSystem:

function onJoin()
if( not connect_mysql ) then
outputChatBox( no_connect_sql_message )
else
local colour = mysql_query( connect_mysql, "SELECT * FROM `players` WHERE serial='" .. getPlayerSerial( source ) .. "'" )
if( colour ) then
while true do
local row = mysql_fetch_assoc( colour )
if ( not row ) then 
if( not TAGS[source] ) then
						nameJoined = getPlayerName( source )
setPlayerNametagColor ( source, 255, 255, 0 )
createBlipAttachedTo( source, 0, 2, 255, 255, 0)
end
break end
					nameJoined = getPlayerName( source )
					name = row['login']
					money = row['money']
local class = row['class']
					TAGS[source] = class
bindKey(source, 'F4', 'down', openPanelForUsers)
bindKey( source, 'm', 'down', secure )
-- [[ Admin ]] --
if( TAGS[source] == "4" ) then
setPlayerNametagColor ( source, 255, 0, 0 )
createBlipAttachedTo( source, 0, 2, 255, 0, 0)
setPlayerMoney( source, money )
if( setUpdateMessage == "1" )  then
outputChatBox("#FF0000*USER: #FFFF00"..updateMessage.."", source, 0, 0, 0, true )
end
-- [[ Moderator ]] --
elseif( TAGS[source] == "3" ) then
setPlayerNametagColor ( source, 0, 0, 255 )
createBlipAttachedTo( source, 0, 2, 0, 0, 255)
setPlayerMoney( source, money )
if( setUpdateMessage == "1" )  then
outputChatBox("#FF0000*USER: #FFFF00"..updateMessage.."", source, 0, 0, 0, true )
end
-- [[ Member ]] --
elseif( TAGS[source] == "2" ) then
setPlayerNametagColor ( source, 0, 255, 0 )
createBlipAttachedTo( source, 0, 2, 0, 255, 0)
setPlayerMoney( source, money )
if( setUpdateMessage == "1" )  then
outputChatBox("#FF0000*USER: #FFFF00"..updateMessage.."", source, 0, 0, 0, true )
end
end
end
end
	mysql_free_result( colour )
end
end

And further down into the script i believe it uses the "class" field once again...

Posted

no, he created his own admin panel which is very limited to toady's admin panel for example cannon's has no admin chat, or ability to start and stop resources or give admin rights.....see? limited. So is it possible to combine it with the acl so toady's panel will work?

Posted

yeah......maybe you shouldn't post in threads you have no clue what your talking about. Try re-reading my other post again and try again. Class and ACL are different therefore how would a script that bases it's scripts on an ACL work on a script that runs on created custom classes? :roll:

Posted
yeah......maybe you shouldn't post in threads you have no clue what your talking about. Try re-reading my other post again and try again. Class and ACL are different therefore how would a script that bases it's scripts on an ACL work on a script that runs on created custom classes? :roll:

Damn girl you got me good with your 5th grade education. I didn't know. I just got MTA. So excuse me girlfriend.

Also I just thought that user system used some other admin panel too. I never looked at it that close.

Edit: I'm all lost... You want to use a different panel for the UserSystem resource? Information on the other panel please?

Posted

I suggest you make a new panel, i did the exact same with this system.

Altough i did modify it and rewrote a lot of functions because the system works very slow on some parts, especially the main parts like class assignment kepth bugging me, so i rewrote the whole thing.

:wink:

PS: I suggest you to add this in your class assignment script: setElementData(source, "class", TAGS[source])

because that will make it possible for you to use the classes outside of the usersystem.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...