Jump to content
  • 0

group level change not working


IsabelaFernandez

Question


  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.07
  • Content Count:  354
  • Reputation:   8
  • Joined:  04/16/18
  • Last Seen:  

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";

 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  896
  • Reputation:   117
  • Joined:  05/23/12
  • Last Seen:  

This should help u.

 

Rynbef~

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.07
  • Content Count:  354
  • Reputation:   8
  • Joined:  04/16/18
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  3
  • Reputation:   0
  • Joined:  05/12/12
  • Last Seen:  

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();

 

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

-	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 by Emistry
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...