dewu Posted September 20, 2014 Share Posted September 20, 2014 Hi guys. I got the question: Is this possible to add user to ACL group by use MTA SDK? Or maybe is other way to do that? Link to comment
Callum Posted September 20, 2014 Share Posted September 20, 2014 Create such a function in Lua and then make it an export, which you can then call from the PHP SDK. You can use PHP SDK for anything, so long as you make a Lua function for it. Link to comment
dewu Posted September 20, 2014 Author Share Posted September 20, 2014 That's right! Maybe some example for function with adding player to acl group? Link to comment
dewu Posted September 22, 2014 Author Share Posted September 22, 2014 Humph, I write something like this: function addvip ( account ) for i, v in pairs ( getElementsByType ( "player" ) ) do local a = getPlayerAccount ( v ) if ( not isGuestAccount ( a ) and getAccountName ( a ) == account ) then aclGroupAddObject (aclGetGroup("VIP"), "user."..v) return true end end return false end PHP side: $account = $_POST["account"]; include("sdk/mta_sdk.php"); $mtaServer = new mta("31.186.83.100", 22013, "mylogin", "mypassword" ); $mtaServer->getResource("vipadd")->call("addvip", $account); and HTML: Login: type="text" name="account"> Link to comment
'LinKin Posted September 24, 2014 Share Posted September 24, 2014 Sorry, what? HTML? I never readed about HTML when I readed about PHP SDK. What do you use that HTML code for? Link to comment
Anubhav Posted September 24, 2014 Share Posted September 24, 2014 Sorry, what? HTML?I never readed about HTML when I readed about PHP SDK. What do you use that HTML code for? Damn see the PHP code. HTML code must be thier to create the edit. PHP posts the text in it. Then you use PHP_SDK functions . Link to comment
'LinKin Posted September 24, 2014 Share Posted September 24, 2014 Oh, I see. yes. . pf Link to comment
./BlackBird# Posted September 25, 2014 Share Posted September 25, 2014 i think it's better to use getAccounts instead of getElementsByType Link to comment
Anubhav Posted September 25, 2014 Share Posted September 25, 2014 I don't think so MJNONFIK. And function addvip ( account ) for i, v in pairs ( getElementsByType ( "player" ) ) do local a = getPlayerAccount ( v ) if ( not isGuestAccount ( a ) and getAccountName ( a ) == account ) then aclGroupAddObject (aclGetGroup("VIP"), "user."..v) aclSave() return true end end return false 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