hadiesyafiq
New member
hi all i use vip script base on group id...but how to put message expired time for that script?i need change the script?i need alter SQL table? can someone teach me?
here vip script that i use..
here SQL table
here the script can someone teach me how add?
here vip script that i use..
function script F_TicketAddVip {
Query_SQL "SELECT `days` FROM `viptable` WHERE `vipacc_id` = '"+GetCharID(3)+"'", .@checkDays;
if (.@checkDays > 0) {
Set .@setDays, (.@checkDays + 30);
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`='2' WHERE `account_id`='"+GetCharID(3)+"'";
}
Else {
Query_SQL "UPDATE `login` SET `group_id`='2' 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$+"','30','"+.@accEmail$+"')";
}
AtCommand "@reloadpcdb";
dispbottom "You received 30 days of VIP Account, congrats!";
specialeffect2 338;
End;
Return;
}
here SQL table
DROP TABLE IF EXISTS `viptable`;
CREATE TABLE `viptable` (
`vipacc_id` int(11) unsigned NOT NULL default '0',
`vip_id` varchar(255) NOT NULL default '',
`days` int(11) NOT NULL default '0',
`email` varchar(39) NOT NULL default '',
PRIMARY KEY (`vipacc_id`),
KEY `name` (`vip_id`)
) ENGINE=MyISAM;
INSERT INTO `viptable` (`vipacc_id`, `vip_id`, `days`, `email`) VALUES ('1', 'VIP', '1', '[email protected]');
here the script can someone teach me how add?
- script VIP_STATUS FAKE_NPC,{
OnPCLoginEvent:
if (getgroupid() >= 2) {
dispbottom "========================";
dispbottom "Account Status : VIP";
dispbottom "Expire Date : "+???;
dispbottom "Time left : "+???
dispbottom "========================";
end;
}
}

