Leaderboard
Popular Content
Showing content with the highest reputation on 12/19/20 in all areas
-
1 point
Request script display time left for vip account
sonyk2 reacted to hadiesyafiq for a post in a topic
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? -
1 point
Request script display time left for vip account
sonyk2 reacted to hadiesyafiq for a post in a topic
Thank you very much sir @Kenpachi all working nice -
1 pointOpen script file in editor. Find the line which contains query_sql "DELETE FROM `viptable` ...... Set cursor to the end of that line (click behind the semicolon) Press Backspace. Save file. You'll notice that the semicolon wasn't removed, because you deleted the hidden character (whitespace) behind it. ~Kenpachi
-
1 point
Request script display time left for vip account
sonyk2 reacted to hadiesyafiq for a post in a topic
Can you teach me how to fix ? -
1 pointThere is a hidden character behind the semicolon in that line. (Probably caused by text encoding mismatch.)
-
1 point
Request script display time left for vip account
sonyk2 reacted to hadiesyafiq for a post in a topic
i got this error @Kenpachi -
1 point
Request script display time left for vip account
sonyk2 reacted to hadiesyafiq for a post in a topic
Thanks @Kenpachi -
1 pointHi. Alter your SQL table: ALTER TABLE `viptable` ADD COLUMN `insert_on` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `email`; Or recreate it: 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 '', `insert_on` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`vipacc_id`), KEY `name` (`vip_id`) ) ENGINE=MyISAM; Change your function (note line 2): function script F_TicketAddVip { 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 + 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; } The info script could look like this: - script VIP_STATUS FAKE_NPC,{ OnPCLoginEvent: if (getgroupid() >= 2) { 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 "========================"; dispbottom "Account Status : VIP"; dispbottom "Expire Date : " + .@expire_date$; dispbottom "Time left : " + .@days_left; dispbottom "========================"; end; } } ~Kenpachi