IsabelaFernandez Posted December 7, 2023 Group: Members Topic Count: 146 Topics Per Day: 0.06 Content Count: 355 Reputation: 8 Joined: 04/16/18 Last Seen: October 21, 2024 Share 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 Link to comment Share on other sites More sharing options...
0 Rynbef Posted December 13, 2023 Group: Forum Moderator Topic Count: 48 Topics Per Day: 0.01 Content Count: 941 Reputation: 125 Joined: 05/23/12 Last Seen: Yesterday at 06:19 AM Share Posted December 13, 2023 This should help u. Rynbef~ Quote Link to comment Share on other sites More sharing options...
0 IsabelaFernandez Posted December 14, 2023 Group: Members Topic Count: 146 Topics Per Day: 0.06 Content Count: 355 Reputation: 8 Joined: 04/16/18 Last Seen: October 21, 2024 Author Share 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 Link to comment Share on other sites More sharing options...
0 Nyxz Posted December 15, 2023 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 3 Reputation: 0 Joined: 05/12/12 Last Seen: August 5, 2024 Share 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 Link to comment Share on other sites More sharing options...
0 Emistry Posted January 23, 2024 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Yesterday at 05:32 PM Share 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 Link to comment Share on other sites More sharing options...
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";
Link to comment
Share on other sites
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.