Jump to content
  • 0
Sign in to follow this  
joven15

HELP VIP System - add command

Question

HI admin PTP , can anyone help me this script . is it possible to add the script for when they buy a prem account. they can use @go, @storage, @loot, @jump. for the certain time only that its set. 

BTW credit to the one who made this script i just saw this script around here in hercules. 

 

 

Quote

prontera,164,169,3    script    Premium Trader    4_F_01,{
    if (#VIP_expire > gettimetick(2)) {
        mes "you are a premium member already!";
        mes "your premium ends in "+callfunc("Time2Str",#VIP_expire);
        if(getstatus(SC_CASH_RECEIVEITEM) <= 0)
        {
            sc_start SC_CASH_RECEIVEITEM,-1,400;
            sc_start SC_CASH_PLUSEXP,-1,400;
        }
        close;
    }
    mes "how long you want to be Premium User?";
    next;
    switch(select("1 day:2 day:7 days:none"))
    {
        case 1:
            if(countitem(7179) >= 1)
            {
                delitem 7179,1;
                callfunc "F_VIPstart",86400;
                mes "Done. enjoy your Premium Services for 1 day.";
                close;
            }
            else
            {
                mes "you don't have 1 x "+getitemname(7179);
                close;
            }
        case 2:
            if(countitem(7179) >= 2)
            {
                delitem 7179,2;
                callfunc "F_VIPstart",172800;
                mes "Done. enjoy your Premium Services for 2 days.";
                close;
            }
            else
            {
                mes "you don't have 2 x "+getitemname(7179);
                close;
            }
        case 3:
            if(countitem(7179) >= 7)
            {
                delitem 7179,7;
                callfunc "F_VIPstart",604800;
                mes "Done. enjoy your Premium Services for 1 Week.";
                close;
            }
            else
            {
                mes "you don't have 7 x "+getitemname(7179);
                close;
            }
        case 4:
            mes "ok then";
            close;
    }
}

function    script    F_VIPstart    {
    set .@ticks,getarg(0); // getarg(0) = ticks (seconds)
    if (.@ticks <= 0) {
        consolemes (CONSOLEMES_WARNING, "F_VIPstart - tried a negative time.");
        end;
    }
    // set a variable, #VIP_expire, as the Unixtime when this expires
    set #VIP_expire, gettimetick(2) + .@ticks;
    // add a timer with that tick (in case they stay logged in that long)
    if (.@ticks < 2147483) { // prevent overflow error
        addtimer .@ticks *1000, "vip_rental::OnVIPend";
    } else {
        addtimer 2147483000, "vip_rental::OnVIPcheck";
    }
    if(getstatus(SC_CASH_RECEIVEITEM) <= 0)
    {
        sc_start SC_CASH_RECEIVEITEM,-1,400;
        sc_start SC_CASH_PLUSEXP,-1,400;
    }
    dispbottom "you are now a premium member!";
    return;
}

-    script    vip_rental    -1,{
OnPCLoginEvent:
    if (VIP_expire > gettimetick(2)) {
        // timer in future
        dispbottom "your premium ends in "+callfunc("Time2Str",VIP_expire);
        if(getstatus(SC_CASH_RECEIVEITEM) <= 0)
        {
            sc_start SC_CASH_RECEIVEITEM,-1,400;
            sc_start SC_CASH_PLUSEXP,-1,400;
        }
    }
OnVIPcheck:
    if (VIP_expire > gettimetick(2)) {
        if ((VIP_expire - gettimetick(2)) < 2147483) { // prevent overflow error
            addtimer (VIP_expire - gettimetick(2)) *1000, strnpcinfo(3)+"::OnVIPend";
        } else {
            addtimer 2147483000, strnpcinfo(3)+"::OnVIPcheck";
        }
    } else if (VIP_expire) {
        // timer already expired
        doevent strnpcinfo(3)+"::OnVIPend";
    }
    end;

OnVIPend:
    set VIP_expire,0; // clear timer
    if(getstatus(SC_CASH_RECEIVEITEM) == 1)
    {
        sc_end SC_CASH_RECEIVEITEM;
        sc_end SC_CASH_PLUSEXP;
    }
    dispbottom "premium ended";
    end;
}
 

 

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

 

a basic google search found this topic

didn't test, but it looks to be most feature complete

 

hmm.................... bad script design though

Share this post


Link to post
Share on other sites
  • 0

ill try thanks

34 minutes ago, AnnieRuru said:

 

a basic google search found this topic

didn't test, but it looks to be most feature complete

 

hmm.................... bad script design though

If ever , the one i mentioned the script i currently using is it possible to add or not ? or do i have to change the whole script ? thanks for the reply in advance.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.