Jump to content

Question

Posted

Hi guys.. I would like to ask for some help...
Could you provide me with an NPC?

Type: When a player goes to jail .. inside the jail he would have a npc where he can pay (x) Zeny to get out of jail or even another character could pay the bail for the player to get out ...

Note: if you can add a command: bindatcmd "bail" to be able to access the npc.. and also "duplicate Npc Bail" ...

Very grateful for everyone's attention! :')

7 answers to this question

Recommended Posts

  • 0
Posted

Hello,

how about this?

-	script	JailSystem#proto	FAKE_NPC,{
	OnBail:
		.@charCount = getareaunits(BL_PC, "sec_pri", 14, 85, 59, 65, .@charNames$);
		mes "[Guard]";
		if(.@charCount == 0) {
			mes "There is no one in jail.";
			close;
		}

		mes "Who do you want to bail out?";
		next;
		select(implode(.@charNames$, ":"));

		mes "[Guard]";
		mes "The fee is " + callfunc("F_InsertComma", .bailOutPrice) + "z. Do you want to pay that?";
		next;
		if (select("Yes:No" ) == 1) {
			mes "[Guard]";
			if(Zeny < .bailOutPrice) {
				mes "It seems you don't have enough money, come back when you have enough.";
				close;
			}

			Zeny -= .bailOutPrice;

			.@addressation$ = (strcharinfo(0) == .@charNames$[@menu - 1]) ? "you" : .@charNames$[@menu - 1];
			mes "Alright, i'll let " + .@addressation$ + " go for now.";
			
			close2;
			atcommand("@unjail " + .@charNames$[@menu - 1]);
			end;
		}
		
		mes "[Guard]";
		mes "You can come back when you change your mind.";
		close;
		end;

	OnInit:
		.bailOutPrice = 10000;
}

-	script	BAIL_ATCOMMAND	FAKE_NPC,{
	OnInit:
		bindatcmd("bail", "Guard#proto::OnBail");
}

prontera, 159, 190, 4	duplicate(JailSystem#proto)	Prison Warden#sec_pri01	4_M_YOUNGKNIGHT
sec_pri, 18, 63, 4	duplicate(JailSystem#proto)	Jail Guard#sec_pri02	4_M_EDEN_GUARDER
sec_pri, 45, 63, 4	duplicate(JailSystem#proto)	Jail Guard#sec_pri03	4_M_LGTGUARD

 

  • Love 1
  • 0
Posted

I got this error:

[Error]:  Loading NPC file: npc/custom/JailSystem.txt
script error on npc/custom/JailSystem.txt line 3
    parse_line: expect command, missing function name or calling undeclared function
     1 : {
     2 :        OnBail:
*    3 :                .@charCount = getareaunits('B'L_PC, "sec_pri", 14, 85, 59, 65, .@charNames$);
     4 :                mes "[Guard]";
     5 :                if(.@charCount == 0) {
     6 :                        mes "There is no one in jail.";
     7 :                        close;
     8 :                }

image.png.1fb1dbfe5f01a45e5ae2b27d2042be74.png

can you help me?

  • 0
Posted (edited)

Hello,

I tested it on my server and I can't reproduce your error. It works fine for me.
Which rAthena version are you using? It seems like your rAthena doesn't know the getareaunits command.

Edited by Winterfox
  • 0
Posted
6 hours ago, Winterfox said:

Hello,

I tested it on my server and I can't reproduce your error. It works fine for me.
Which rAthena version are you using? It seems like your rAthena doesn't know the getareaunits command.

I use this patch version: @Winterfox
#ifndef PACKETVER
#define PACKETVER 20151104
//#define PACKETVER 20120410

But I don't know how to check the rAthena version.. ''/

 

4 hours ago, Emistry said:

there exists a default script for unjail if you are interested with it

npc/custom/etc/penal_servitude.txt

I didn't test the sling but can a player who is not arrested pay the bail of someone who is arrested? @Emistry

  • 0
Posted (edited)

Based on your packet version, your rAthena is pretty old. The current packt version is 20211103.
The included script doesn't allow others to bail someone out. You can only bail yourself out via payment or labor.

It also seems like it doesn't work anymore, since it doesn't really unjail you, but tries to warp you out of jail and change your savepoint which fails.
But it might be that on your server version it still works.

Edited by Winterfox
  • Like 1

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...