Jump to content

[HELP] Vip System


vGrosho

Recommended Posts


 

addCommandHandler("addvip",
function (thePlayer, cmd)
    local account = getPlayerAccount(thePlayer)
    local accountName = getAccountName(account)
    if not player then outputChatBox("The player has left, or you have spelled his name wrong",source,255,0,0) return end
    if isPlayerVIP(getAccountName(getPlayerAccount(player))) then outputChatBox("This player is already VIP, source", 255,0,0) return end
    if addVIPToDatabase(getAccountName(getPlayerAccount(player)) then
        setElementData(player,"VIP","Yes")
    end
end)

Something like this to create VIP system.

Link to comment

Hey. I don't think that if you're new at mta scripting, you should not start with a VIP system. But i would use functions like:

setElementData()
getRealTime()

With these you can set the VIP level of the player in an easily reachable way. Also you have to store the expiration data in internaldb, in an SQL, or in a text file (i do not recommend this).

you can check with "if CONDITION then CODE end" if the player has an expired VIP.

for the command:

addCommandHandler()
getPlayerFromName()

 

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