Jump to content
  • 0
Sign in to follow this  
hadiesyafiq

HELP announcement getitem script

Question

Hi all can someone help me to understand "getitemname" because i make this script is successful announce but the item name show "null"

i make bet npc that will announce item that player get but annouce show "null"

here my test script...

prontera,151,183,6	script	Rika Exchange	4_F_KAFRA8,{
	if (checkweight(Knife,1) == 0 || (MaxWeight - Weight) < 10000) {
		mes "[Rika]";
		close;
	}
	mes "[Rika]";
	mes "Hi place your bet....";
	next;
	switch (select("2M Zeny", "5M Zeny", "10M Zeny")) {
	case 1:
		mes "[Rika]";
		mes "Good good, let me just check";
		next;
		if (Zeny < 2000000)
		{
			mes "[Rika]";
			mes "Sorry, but you lack some money...";
			close;
		}
		set Zeny, Zeny - 2000000;
		getitem F_Rand( 656, 657, 505, 645, 506, 14510 ), rand(1,1);
		announce "[Rika] : "+strcharinfo(PC_NAME)+" get "+getitemname( "" )+".",bc_all;
		close;
	case 2:
		mes "[Rika]";
		mes "Good good, let me just check";
		next;
		if (Zeny < 5000000)
		{
			mes "[Rika]";
			mes "Sorry, but you lack some money...";
			close;
		}
		set Zeny, Zeny - 5000000;
		getitem F_Rand( 656, 657, 505, 645, 506, 14510 ), rand(1,1);
		announce "[Rika] : "+strcharinfo(PC_NAME)+" get "+getitemname( "" )+".",bc_all;
		close;
	case 3:
		mes "[Rika]";
		mes "Good good, let me just check";
		next;
		if (Zeny < 10000000)
		{
			mes "[Rika]";
			mes "Sorry, but you lack some money...";
			close;
		}
		set Zeny, Zeny - 10000000;
		getitem F_Rand( 656, 657, 505, 645, 506, 14510 ), rand(1,1);
		announce "[Rika] : "+strcharinfo(PC_NAME)+" get "+getitemname( "" )+".",bc_all;
		close;

	}
OnPCLoadMapEvent:
if (strcharinfo(3) == strnpcinfo(4))
    showevent QTYPE_QUEST2,1;
end;
}

how to make is show item name not "null"

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0
On 7/14/2021 at 2:44 AM, fTakano said:

You need a parameter inside the `getitemname` script command.

e.g. getitemname(Red_Potion)  will show "Red Potion".

Ya the script is get random item..how to make it show the item they get?please help me about this script 🙏

Share this post


Link to post
Share on other sites
  • 0

First, you need to set a variable for the F_Rand().

.@Item = F_Rand(656, 657, 505, 645, 506, 14510);

getitem .@Item, rand(1,1);

announce "[Rika] : "+strcharinfo(PC_NAME)+" get "+getitemname(.@Item)+".",bc_all;

Share this post


Link to post
Share on other sites
  • 0
10 minutes ago, fTakano said:

First, you need to set a variable for the F_Rand().

.@Item = F_Rand(656, 657, 505, 645, 506, 14510);

getitem .@Item, rand(1,1);

announce "[Rika] : "+strcharinfo(PC_NAME)+" get "+getitemname(.@Item)+".",bc_all;

thank you very much

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.