IsabelaFernandez Posted December 7, 2023 Posted December 7, 2023 Hi people. I have this script for changing groups but I check the database and the char remains in the default group 0, I used it on an item and the message appears in the game that it was active but nothing is changed in the DB. script: Spoiler - script vip_group_free -1,{ OnSetVIP: #TEMP_GROUP_V = gettimetick(2) + (7 * 24 * 60 * 60);//time in seconds OnPCLoginEvent: if (#TEMP_GROUP_V > gettimetick(2)) { atcommand "@adjgroupid 5"; .@second = #TEMP_GROUP_V - gettimetick(2); addtimer (.@second * 1000), strnpcinfo(3)+"::OnExpire"; dispbottom "Seu VIP expira em: "+gettimestr("%Y-%m/%d %H:%M:%S",21,#TEMP_GROUP_V); } end; OnExpire: atcommand "@adjgroupid 0"; end; } item_db_usable.yml: Spoiler - Id: 7551 AegisName: Ticket02 Name: 6.18 Ticket Type: Usable Buy: 20 Weight: 10 Trade: NoDrop: true NoTrade: true NoCart: true NoStorage: true NoGuildStorage: true NoMail: true NoAuction: true Script: | doevent "vip_group_free::OnSetVIP"; Quote
0 IsabelaFernandez Posted December 14, 2023 Author Posted December 14, 2023 23 hours ago, Rynbef said: This should help u. Rynbef~ thanks. I had already looked for my old post, but unfortunately the group is not changing, it remains 0 in the SQL DB, it is not gone due to changes or updates to the emulator Quote
0 Nyxz Posted December 15, 2023 Posted December 15, 2023 Change atcommand "@adjgroupid 5"; >> atcommand "@adjgroup 5"; Also, group_id is not changing in SQL DB because it is temporary until players log out. You can also add this line to check whether the group has changed or not. dispbottom "Group level "+getgmlevel(); Quote
0 Emistry Posted January 23, 2024 Posted January 23, 2024 (edited) - script vip_group_free -1,{ OnSetVIP: #TEMP_GROUP_V = gettimetick(2) + (7 * 24 * 60 * 60);//time in seconds OnPCLoginEvent: if (#TEMP_GROUP_V > gettimetick(2)) { if (getgroupid() == 0) { query_sql("UPDATE `login` SET `group_id` = 5 WHERE `account_id` = "+getcharid(3)); atcommand "@adjgroupid 5"; } .@second = #TEMP_GROUP_V - gettimetick(2); addtimer (.@second * 1000), strnpcinfo(3)+"::OnExpire"; dispbottom "Seu VIP expira em: "+gettimestr("%Y-%m/%d %H:%M:%S",21,#TEMP_GROUP_V); } end; OnExpire: if (getgroupid() == 5) query_sql("UPDATE `login` SET `group_id` = 0 WHERE `account_id` = "+getcharid(3)); atcommand "@adjgroupid 0"; end; } something like this ? perhaps just use the built-in VIP system ? conf\login_athena.conf // Which group (ID) will be denoted as the VIP group? // Default: 5 vip_group: 5 Edited January 23, 2024 by Emistry Quote
Question
IsabelaFernandez
Hi people. I have this script for changing groups but I check the database and the char remains in the default group 0, I used it on an item and the message appears in the game that it was active but nothing is changed in the DB.
script:
- script vip_group_free -1,{
OnSetVIP:
#TEMP_GROUP_V = gettimetick(2) + (7 * 24 * 60 * 60);//time in seconds
OnPCLoginEvent:
if (#TEMP_GROUP_V > gettimetick(2)) {
atcommand "@adjgroupid 5";
.@second = #TEMP_GROUP_V - gettimetick(2);
addtimer (.@second * 1000), strnpcinfo(3)+"::OnExpire";
dispbottom "Seu VIP expira em: "+gettimestr("%Y-%m/%d %H:%M:%S",21,#TEMP_GROUP_V);
}
end;
OnExpire:
atcommand "@adjgroupid 0";
end;
}
item_db_usable.yml:
- Id: 7551
AegisName: Ticket02
Name: 6.18 Ticket
Type: Usable
Buy: 20
Weight: 10
Trade:
NoDrop: true
NoTrade: true
NoCart: true
NoStorage: true
NoGuildStorage: true
NoMail: true
NoAuction: true
Script: |
doevent "vip_group_free::OnSetVIP";
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.