• 0
JHONDOMINIC

Help me about Variable.

Question

morocc,172,162,4	script	Slave	96,{

set .ItemSlave, 7224;
set .ItemAmount, 50;
set .SlaveTime, 360;
set .SlaveTimeOut, .SlaveTime*1000;

getmapxy(@map$, @xb, @yb, 0);

if ( cloneactive == 1 ) {
	mes "[ Slave System ]";
	mes "^FF0000YYour slave still alive";
	mes Or not time out^000000";
	close;
}

	if ( countitem(.ItemSlave) < .ItemAmount ) {
		mes "[ Slave System ]";
		mes "^FF0000You have "+getitemname(.ItemSlave)+"";
		mes "less than "+.ItemAmount+" ea";
		mes "Can't clone your slave";
		close;
	}

delitem .ItemSlave, .ItemAmount;
clone @map$,@xb,@yb,strnpcinfo(0) + "::OnSlaveDead",getcharid(0),getcharid(0),0,1,.SlaveTime;
addtimer .SlaveTimeOut, strnpcinfo(0) + "::OnSlaveTimeout";
set cloneactive, 1;
end;

OnSlaveDead:
set cloneactive, 0;
end;

OnSlaveTimeout:
set cloneactive, 0;
end; 

Cancel:
close;
}

I have a problem about Variable.

I want to make Slave for rent.

1 player can rent only one slave and they can rent again after slave die or timeout.

70184250_235524047361784_7491064645222924288_n.jpg

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Try this one

morocc,172,162,4	script	Slave	96,{

.ItemSlave		= 7224;
.ItemAmount		= 50;
.SlaveTime		= 360;
.SlaveTimeOut	= .SlaveTime*1000;

getmapxy @map$, @xb, @yb, BL_PC;

	if ( cloneactive == 1 ) {
		mes "[ Slave System ]";
		mes "^FF0000YYour slave still alive";
		mes Or not time out^000000";
		close;
	}

	if ( countitem(.ItemSlave) < .ItemAmount ) {
		mes "[ Slave System ]";
		mes "^FF0000You have "+getitemname(.ItemSlave)+"";
		mes "less than "+.ItemAmount+" ea";
		mes "Can't clone your slave";
		close;
	}

	delitem .ItemSlave, .ItemAmount;
	clone @map$, @xb, @yb, strnpcinfo(0) + "::OnSlaveDead",getcharid(0),getcharid(0),0,1,.SlaveTime;
	addtimer .SlaveTimeOut, strnpcinfo(0) + "::OnSlaveTimeout";
	cloneactive = 1;
	end;

OnSlaveDead:
	cloneactive = 0;
	end;

OnSlaveTimeout:
	cloneactive = 0;
	end; 

Cancel:
	end;
}

 

Share this post


Link to post
Share on other sites
  • 0

@Radian Thank you very much, I already try.

When slave timeout it working can set variable to player character. But when slave die same problem "No player attached for player variable".

Edited by JHONDOMINIC

Share this post


Link to post
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.

Loading...