Jump to content

[REL] Add / Del accounts ..!


PaiN^

Recommended Posts

Hello everyone

Today I finished my resource :

Add / Del Account

What does it do ?

--> It's Add / Del accounts from your server ..

--> All the players can add accounts, But only people in Console group can delete accounts ..

--> Script is unencrypted, Modify it as you like but don't remove my name ..

* It must be added to admin group ..

*Notify me if any bugs are noticed ..

Link to comment

addEvent("add", true) 
addEventHandler("add", root, 
    function (auser, pass) 
        if string.len(auser) > 0 and string.len(pass) > 0 then 
                                                      local account = getAccount(duser) 
                                                      if account then 
                outputChatBox("#3BB9FF#Account already exist ..!", source, 255, 0, 0, true) 
            else 
                addAccount(auser, pass) 
                outputChatBox("#3BB9FF#Account is created ..!", source, 255, 0, 0, true) 
                outputChatBox("#3BB9FF#Username : #FFFFFF"..auser.."#3BB9FF, #Password : #FFFFFF"..pass, source, 255, 0, 0, true) 
            end 
        else 
            outputChatBox("#3BB9FF#Username was #FF0000not found #3BB9FF..!", source, 255, 0, 0, true) 
        end 
    end 
) 
  

You Have To Get The Account :?!!

Link to comment
addEvent("add", true) 
addEventHandler("add", root, 
    function (auser, pass) 
        if string.len(auser) > 0 and string.len(pass) > 0 then 
                                                      local account = getAccount(duser) 
                                                      if account then 
                outputChatBox("#3BB9FF#Account already exist ..!", source, 255, 0, 0, true) 
            else 
                addAccount(auser, pass) 
                outputChatBox("#3BB9FF#Account is created ..!", source, 255, 0, 0, true) 
                outputChatBox("#3BB9FF#Username : #FFFFFF"..auser.."#3BB9FF, #Password : #FFFFFF"..pass, source, 255, 0, 0, true) 
            end 
        else 
            outputChatBox("#3BB9FF#Username was #FF0000not found #3BB9FF..!", source, 255, 0, 0, true) 
        end 
    end 
) 
  

You Have To Get The Account !!

But i did that !!!

addEvent("add", true) 
addEventHandler("add", root, 
    function (auser, pass) 
        if string.len(auser) > 0 and string.len(pass) > 0 then 
            local check = getAccountName(auser) 
            if check then 
                outputChatBox("#3BB9FF#Account already exist ..!", source, 255, 0, 0, true) 
            else 
                addAccount(auser, pass) 
                outputChatBox("#3BB9FF#Account is created ..!", source, 255, 0, 0, true) 
                outputChatBox("#3BB9FF#Username : #FFFFFF"..auser.."#3BB9FF, #Password : #FFFFFF"..pass, source, 255, 0, 0, true) 
            end 
        else 
            outputChatBox("#3BB9FF#Username was #FF0000not found #3BB9FF..!", source, 255, 0, 0, true) 
        end 
    end 
) 

And the script works perfectly + No errors in debugscript !!!

Link to comment

LoL?

outputChatBox("#3BB9FF#Account already exist ..!", source, 255, 0, 0, true) 

Have you ever saw this when you add an account already exist? because getAccountName will always return false and it will return it to the else.

And btw, you are trigger the source as root, so everyone will see the outputChatBox, and this means the password will be in chat for everyone. :lol::lol::lol:

Link to comment
LoL?
outputChatBox("#3BB9FF#Account already exist ..!", source, 255, 0, 0, true) 

Have you ever saw this when you add an account already exist? because getAccountName will always return false and it will return it to the else.

And btw, you are trigger the source as root, so everyone will see the outputChatBox, and this means the password will be in chat for everyone. :lol::lol::lol:

LooooooooooooL :?

Link to comment
It's Return string !

Returns a string containing the account's name, false if the account does not exist or an invalid argument was passed to the function

Ok don't tell anyone.

I already know this, i was meaning false in his cause.

He trying to get account name from account name <~ this funny. :mrgreen:

Link to comment

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