Jump to content

MTA SDK Adding user to ACL group


dewu

Recommended Posts

Posted

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.

Posted

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"> 

Posted
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

.

Posted

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 
  

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...