blakbord Posted February 5, 2016 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 108 Reputation: 1 Joined: 02/10/12 Last Seen: March 10, 2024 Share Posted February 5, 2016 I want a script that has to do with groupid(),scenario goes like this: when a player make a new account his groupid is groupid(0) as default when he LOGIN in the game, I want his groupid to be groupid(1) groupid(1) = special account that is good for 1 week hope that someone can help me about this script.. thanks in advance.. Quote Link to comment Share on other sites More sharing options...
0 Brian Posted February 19, 2016 Group: Members Topic Count: 75 Topics Per Day: 0.02 Content Count: 2223 Reputation: 593 Joined: 10/26/11 Last Seen: June 2, 2018 Share Posted February 19, 2016 Add this getgroupid check at the beginning: - script vip_for_1week -1,{ OnPCLoginEvent: if (getgroupid() != 0) end; // first time logging into this account if (#VIP_expire == 0) { set #VIP_expire, gettimetick(2) + (7*86400); // 7 days dispbottom "Welcome to the server!"; dispbottom "You have been upgraded to a VIP for 1 week."; } if (#VIP_expire > gettimetick(2)) { // they still have time left dispbottom "VIP Rental : expires in " + callfunc("Time2Str",#VIP_expire); atcommand "@adjgroup 1"; deltimer strnpcinfo(3)+"::OnPCLoginEvent"; if ((#VIP_expire - gettimetick(2)) < 2147483) { // prevent overflow error addtimer (#VIP_expire - gettimetick(2)) *1000, strnpcinfo(3)+"::OnPCLoginEvent"; } else { addtimer 2147483000, strnpcinfo(3)+"::OnPCLoginEvent"; } } else if (#VIP_expire > 1) { set #VIP_expire, 1; atcommand "@adjgroup 0"; dispbottom "Your VIP Rental has expired."; } end; } Quote Link to comment Share on other sites More sharing options...
0 Brian Posted February 7, 2016 Group: Members Topic Count: 75 Topics Per Day: 0.02 Content Count: 2223 Reputation: 593 Joined: 10/26/11 Last Seen: June 2, 2018 Share Posted February 7, 2016 - script vip_for_1week -1,{ OnPCLoginEvent: // first time logging into this account if (#VIP_expire == 0) { set #VIP_expire, gettimetick(2) + (7*86400); // 7 days dispbottom "Welcome to the server!"; dispbottom "You have been upgraded to a VIP for 1 week."; } if (#VIP_expire > gettimetick(2)) { // they still have time left dispbottom "VIP Rental : expires in " + callfunc("Time2Str",#VIP_expire); atcommand "@adjgroup 1"; deltimer strnpcinfo(3)+"::OnPCLoginEvent"; if ((#VIP_expire - gettimetick(2)) < 2147483) { // prevent overflow error addtimer (#VIP_expire - gettimetick(2)) *1000, strnpcinfo(3)+"::OnPCLoginEvent"; } else { addtimer 2147483000, strnpcinfo(3)+"::OnPCLoginEvent"; } } else if (#VIP_expire > 1) { set #VIP_expire, 1; atcommand "@adjgroup 0"; dispbottom "Your VIP Rental has expired."; } end; }The values of the variable #VIP_expire0 = they never logged in 1 = they used VIP for 1 week and now it's over gettimetick(2) = VIP is active and that's the UNIX time when it expires Quote Link to comment Share on other sites More sharing options...
0 blakbord Posted February 19, 2016 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 108 Reputation: 1 Joined: 02/10/12 Last Seen: March 10, 2024 Author Share Posted February 19, 2016 it's working, thanks a lot for this script you made.. but there is a problem with the script, GM ACCOUNT is affected.. how can I disable this for only GM ACCOUNT? Quote Link to comment Share on other sites More sharing options...
0 blakbord Posted February 19, 2016 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 108 Reputation: 1 Joined: 02/10/12 Last Seen: March 10, 2024 Author Share Posted February 19, 2016 (edited) thanks for the fast reply, it's working now.. thank you so much for your help and for this script.. Edited February 19, 2016 by blakbord Quote Link to comment Share on other sites More sharing options...
0 blakbord Posted July 1, 2016 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 108 Reputation: 1 Joined: 02/10/12 Last Seen: March 10, 2024 Author Share Posted July 1, 2016 Add this getgroupid check at the beginning: - script vip_for_1week -1,{ OnPCLoginEvent: if (getgroupid() != 0) end; // first time logging into this account if (#VIP_expire == 0) { set #VIP_expire, gettimetick(2) + (7*86400); // 7 days dispbottom "Welcome to the server!"; dispbottom "You have been upgraded to a VIP for 1 week."; } if (#VIP_expire > gettimetick(2)) { // they still have time left dispbottom "VIP Rental : expires in " + callfunc("Time2Str",#VIP_expire); atcommand "@adjgroup 1"; deltimer strnpcinfo(3)+"::OnPCLoginEvent"; if ((#VIP_expire - gettimetick(2)) < 2147483) { // prevent overflow error addtimer (#VIP_expire - gettimetick(2)) *1000, strnpcinfo(3)+"::OnPCLoginEvent"; } else { addtimer 2147483000, strnpcinfo(3)+"::OnPCLoginEvent"; } } else if (#VIP_expire > 1) { set #VIP_expire, 1; atcommand "@adjgroup 0"; dispbottom "Your VIP Rental has expired."; } end; } I want to use this script in an item for example.. 670,Gold_Coin_Moneybag,Bag of Gold Coins,0,100000,,400,,,,,0xFFFFFFFF,7,2,,,,,,{},{},{} thanks.. Quote Link to comment Share on other sites More sharing options...
Question
blakbord
I want a script that has to do with groupid(),
scenario goes like this:
when a player make a new account his groupid is groupid(0) as default
when he LOGIN in the game, I want his groupid to be groupid(1)
groupid(1) = special account that is good for 1 week
hope that someone can help me about this script.. thanks in advance..
Link to comment
Share on other sites
5 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.