Jump to content

Question

Posted

This is the code that i found searching but it's not right when displaying it on icon timer.

	if ( vip_status(1) ) {
			set .@timer, vip_status(2) - gettimetick(2);
        	fakeIcon(getcharid(0),EFST_VIPSTATE2,.@timer,1);					
			set MaxWeight, MaxWeight + 2000;
			hateffect 19,true;
			dispbottom "Server Time: "+gettimestr("%H:%M:%S", 10)+"";
			dispbottom "=============================================";
			dispbottom "Account Status : Premium Account";
			dispbottom "Account Status : Exp & Job Increase 100%";
			dispbottom "Account Status : Drop Increase 100%";
			dispbottom "Time left : "+ callfunc("Time2Str",vip_status(VIP_STATUS_EXPIRE));
			dispbottom "=============================================";
    		end;
}

it's always 1 minute

image.png.e845972760387b93e785de53ee7d903a.png

5 answers to this question

Recommended Posts

  • 0
Posted

Nevermind I edited the src. Anyone interested here it is, this also fix the icon not going away and entering negative values for timer.

// Script.cpp
+/*
+* fakeIcon
+* fakeIcon(CHAR_ID,ICON_ID,TIME,STATE)
+*/
+BUILDIN_FUNC(fakeIcon)
+{
+	int16 icon = EFST_BLANK;
+	TBL_PC* sd = map_charid2sd(script_getnum(st, 2));
+	FETCH(3, icon);
+	int time = 1000 * abs(script_getnum(st, 4));
+	bool state = (script_getnum(st, 5) == 1);
+
+	if (sd == NULL)
+		return SCRIPT_CMD_FAILURE;
+
+	if (icon <= EFST_BLANK || icon >= EFST_MAX)
+		icon = EFST_BLANK;
+		
+	clif_status_change(&sd->bl, (enum efst_type)icon, state, time, 0, 0, 0);
+
+	return SCRIPT_CMD_SUCCESS;
+}

BUILDIN_FUNC(addrid)

// Script.cpp

++BUILDIN_DEF(fakeIcon,"iiii"),
BUILDIN_DEF(goto,"l"),

image.png.c9031d583739722ff3998a0d8a49c6d4.png

  • 0
Posted
47 minutes ago, Louis T Steinhil said:

This is the code that i found searching but it's not right when displaying it on icon timer.

	if ( vip_status(1) ) {
			set .@timer, vip_status(2) - gettimetick(2);
        	fakeIcon(getcharid(0),EFST_VIPSTATE2,.@timer,1);					
			set MaxWeight, MaxWeight + 2000;
			hateffect 19,true;
			dispbottom "Server Time: "+gettimestr("%H:%M:%S", 10)+"";
			dispbottom "=============================================";
			dispbottom "Account Status : Premium Account";
			dispbottom "Account Status : Exp & Job Increase 100%";
			dispbottom "Account Status : Drop Increase 100%";
			dispbottom "Time left : "+ callfunc("Time2Str",vip_status(VIP_STATUS_EXPIRE));
			dispbottom "=============================================";
    		end;
}

it's always 1 minute

image.png.e845972760387b93e785de53ee7d903a.png

that is stateicon description.

the code you show is displaybottom which will be display at chat.

  • Upvote 1
  • 0
Posted
On 6/16/2024 at 11:13 AM, Louis T Steinhil said:

Nevermind I edited the src. Anyone interested here it is, this also fix the icon not going away and entering negative values for timer.

// Script.cpp
+/*
+* fakeIcon
+* fakeIcon(CHAR_ID,ICON_ID,TIME,STATE)
+*/
+BUILDIN_FUNC(fakeIcon)
+{
+	int16 icon = EFST_BLANK;
+	TBL_PC* sd = map_charid2sd(script_getnum(st, 2));
+	FETCH(3, icon);
+	int time = 1000 * abs(script_getnum(st, 4));
+	bool state = (script_getnum(st, 5) == 1);
+
+	if (sd == NULL)
+		return SCRIPT_CMD_FAILURE;
+
+	if (icon <= EFST_BLANK || icon >= EFST_MAX)
+		icon = EFST_BLANK;
+		
+	clif_status_change(&sd->bl, (enum efst_type)icon, state, time, 0, 0, 0);
+
+	return SCRIPT_CMD_SUCCESS;
+}

BUILDIN_FUNC(addrid)

// Script.cpp

++BUILDIN_DEF(fakeIcon,"iiii"),
BUILDIN_DEF(goto,"l"),

image.png.c9031d583739722ff3998a0d8a49c6d4.png

Can you share the script? It's not working on my end. I've already added the source code, but the timer continues running even after I logout.

Proof:
image.png.c46cd948cd542bbc319a276dfc1fdbea.png

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...