how to make expired script for VIP ?

hadiesyafiq

New member
Messages
160
Points
0
Age
35
Location
Malaysia
Github
hadiesyafiq
Emulator
hi all this is vip script to make account be group id 2 for 3 days...but after 3 days the accounte stil vip status..how to change?

After 5 days it wil be -2days

function    script    F_TicketAddVip_3    {
    query_sql "DELETE FROM `viptable` WHERE `vipacc_id` = '"+getcharid(3)+"' AND DATEDIFF(DATE_ADD(`insert_on`, INTERVAL `days` DAY), NOW()) < 0"; // remove expired VIP status before reapplying
    query_sql "SELECT `days` FROM `viptable` WHERE `vipacc_id` = '"+getcharid(3)+"'", .@checkDays;
    if (.@checkDays > 0) {
        set .@setDays, (.@checkDays + 3);
        query_sql "UPDATE `viptable` SET `days`='"+.@setDays+"' WHERE `vipacc_id`='"+getcharid(3)+"'";
        query_sql "SELECT `group_id` FROM `login` WHERE `account_id`='"+getcharid(3)+"'", .@userLevel;
        if (.@userLevel < 1) 
            query_sql "UPDATE `login` SET `group_id`='1' WHERE `account_id`='"+getcharid(3)+"'";
    }
    else {
        query_sql "UPDATE `login` SET `group_id`='1' WHERE `account_id`='"+getcharid(3)+"'";
        query_sql "SELECT `userid` FROM `login` WHERE `account_id`='"+getcharid(3)+"'", .@userID$;
        query_sql "SELECT `email` FROM `login` WHERE `account_id`='"+getcharid(3)+"'", .@userEmail$;
        query_sql "INSERT INTO `viptable` (`vipacc_id`,`vip_id`,`days`,`email`) VALUES ('"+getcharid(3)+"','"+.@userID$+"','3','"+.@accEmail$+"')";
    }
    mes "[ ^990099Geovani^000000 ]";
    mes "You received 3 days of VIP Account!";
    mes "Please relog to see the changes in your account.";
    close;
return;
}
 


viptime.png

 
- script VIP script FAKE_NPC,{

OnPCLoginEvent:
if (#AccountVIP >= gettimetick(2)) {
ModExp = 100;
ModDrop = 100;
} else if (getgroupid() == 2) {
ModExp = 150;
ModDrop = 150;
}
end;


}

function script F_TicketAddVip_3 {
#AccountVIP = gettimetick(2) + (60*60*24*3);
ModExp = 150;
ModDrop = 150;
mes "[ ^990099Geovani^000000 ]";
mes "You received 3 days of VIP Account!";
close;
}


Try this

 
- script VIP script FAKE_NPC,{ OnPCLoginEvent: if (#AccountVIP >= gettimetick(2)) { ModExp = 100; ModDrop = 100; } else if (getgroupid() == 2) { ModExp = 150; ModDrop = 150; } end; } function script F_TicketAddVip_3 { #AccountVIP = gettimetick(2) + (60*60*24*3); ModExp = 150; ModDrop = 150; mes "[ ^990099Geovani^000000 ]"; mes "You received 3 days of VIP Account!"; close; }

- script VIP script FAKE_NPC,{

OnPCLoginEvent:
if (#AccountVIP >= gettimetick(2)) {
ModExp = 100;
ModDrop = 100;
} else if (getgroupid() == 2) {
ModExp = 150;
ModDrop = 150;
}
end;


}

function script F_TicketAddVip_3 {
#AccountVIP = gettimetick(2) + (60*60*24*3);
ModExp = 150;
ModDrop = 150;
mes "[ ^990099Geovani^000000 ]";
mes "You received 3 days of VIP Account!";
close;
}


Try this
thank you sir @Dastgir but without SQL how can i use vip status script?

here the script 

-    script    VIP_STATUS    FAKE_NPC,{
OnPCLoginEvent:
    if (getgroupid() >= 1) {
        query_sql "SELECT DATE(DATE_ADD(`insert_on`, INTERVAL `days` DAY)), DATEDIFF(DATE_ADD(`insert_on`, INTERVAL `days` DAY), NOW()) FROM `viptable` WHERE `vipacc_id` = '"+getcharid(3)+"'", .@expire_date$, .@days_left;
            dispbottom "You're currently a VIP Member.";
            dispbottom "============================================";
            dispbottom "Account Status : EXP & DROP Increase 50%.";
            dispbottom "VIP rates are: Base EXP - 150% | Base DROP - 150%.";
            dispbottom "Expire Date : " + .@expire_date$;
            dispbottom "Days left : "+ .@days_left;
            dispbottom "============================================";
        end;
    }
}
thanks again sir

 
Last edited by a moderator:
thank you sir @Dastgir but without SQL how can i use vip status script?

here the script 

thanks again sir
Hercules does support basic vip.

Modifying ModDrop and ModExp will change the experience gained and drop rate for that specific account. 

 
Back
Top