Jump to content
  • 0

my script doesn't auto warp?


Question

Posted

guys i have problem with auto warp.if some one login.it's auto warp to some where.and i will ask..if some one dead how to make auto warp in some where??

this is my script

- script Race_system -1,{

OnPCLoginEvent:

if (strcharinfo(4) == "Hades") goto L_Hades;

if (strcharinfo(4) == "Athena") goto L_Athena;

if (strcharinfo(4) == "") goto L_no;

L_Hades:

warp "Gonryun",159,158;

end;

L_Athena:

warp "Lighthalzen",159,90;

end;

L_no:

warp "izlude",94,103;

end;

}

11 answers to this question

Recommended Posts

Posted (edited)

Don't forget to raise people before warping when they are dead, just not to fall into some weird bugs.

OnPCDieEvent:
atcommand "@raise";
if( <condition> )
warp "<map>", <x>, <y>;
else if( <condition> )
warp "<map>", <x>, <y>;
//[...]

Edited by Ryokem
  • Upvote 1
Posted

erm ....

*strcharinfo(<type>)

This function will return either the name, party name or guild name for the

invoking character. Whatever it returns is determined by type.

0 - Character's name.

1 - The name of the party they're in if any.

2 - The name of the guild they're in if any.

3 - The name of the map the character is in.

If a character is not a member of any party or guild, an empty string will be

is there any strcharinfo(4) in the 1st place ?

BUILDIN_FUNC(strcharinfo)
{
TBL_PC *sd;
int num;
struct guild* g;
struct party_data* p;

sd=script_rid2sd(st);
if (!sd) { //Avoid crashing....
	script_pushconststr(st,"");
	return 0;
}
num=script_getnum(st,2);
switch(num){
	case 0:
		script_pushstrcopy(st,sd->status.name);
		break;
	case 1:
		if( ( p = party_search(sd->status.party_id) ) != NULL )
		{
			script_pushstrcopy(st,p->party.name);
		}
		else
		{
			script_pushconststr(st,"");
		}
		break;
	case 2:
		if( ( g = guild_search(sd->status.guild_id) ) != NULL )
		{
			script_pushstrcopy(st,g->name);
		}
		else
		{
			script_pushconststr(st,"");
		}
		break;
	case 3:
		script_pushconststr(st,map[sd->bl.m].name);
		break;
	default:
		ShowWarning("buildin_strcharinfo: unknown parameter.\n");
		script_pushconststr(st,"");
		break;
}

return 0;
}

shouldn't be like ... the server throw error for you ?

ShowWarning("buildin_strcharinfo: unknown parameter.\n");

Posted

bcause you didnt add a label to be trigger upon dead...refer previous post

tq emistry :)...i will try again :D...

erm ....

*strcharinfo(<type>)

This function will return either the name, party name or guild name for the

invoking character. Whatever it returns is determined by type.

0 - Character's name.

1 - The name of the party they're in if any.

2 - The name of the guild they're in if any.

3 - The name of the map the character is in.

If a character is not a member of any party or guild, an empty string will be

is there any strcharinfo(4) in the 1st place ?

BUILDIN_FUNC(strcharinfo)
{
TBL_PC *sd;
int num;
struct guild* g;
struct party_data* p;

sd=script_rid2sd(st);
if (!sd) { //Avoid crashing....
	script_pushconststr(st,"");
	return 0;
}
num=script_getnum(st,2);
switch(num){
	case 0:
		script_pushstrcopy(st,sd->status.name);
		break;
	case 1:
		if( ( p = party_search(sd->status.party_id) ) != NULL )
		{
			script_pushstrcopy(st,p->party.name);
		}
		else
		{
			script_pushconststr(st,"");
		}
		break;
	case 2:
		if( ( g = guild_search(sd->status.guild_id) ) != NULL )
		{
			script_pushstrcopy(st,g->name);
		}
		else
		{
			script_pushconststr(st,"");
		}
		break;
	case 3:
		script_pushconststr(st,map[sd->bl.m].name);
		break;
	default:
		ShowWarning("buildin_strcharinfo: unknown parameter.\n");
		script_pushconststr(st,"");
		break;
}

return 0;
}

shouldn't be like ... the server throw error for you ?

ShowWarning("buildin_strcharinfo: unknown parameter.\n");

yep i use faction system annie..:) so it's extended number 4 it's player faction..:)

Posted (edited)

lol faction system

so many members has tried to code it and release it in the past, all of them lost interest one after another...

because our SVN is always on the update, a big modification like that sure get broken very fast

I wont recommend having faction system in RO either ... usually this kind of modification is a paid job ...

and need to upkeep with each SVN updates and make sure it wont break your server

if you are talking about faction system respawn, you need to learn this script command

*savepoint "<map name>",<x>,<y>;

*save "<map name>",<x>,<y>;

This command saves where the invoking character will return to upon

'return to save point', if dead or in some other cases. The two versions are

equivalent. Map name, X coordinate and Y coordinate should be perfectly obvious.

This ignores any and all map flags, and can make a character respawn where no

teleportation is otherwise possible.

savepoint "place",350,75;

don't abuse OnPCDieEvent like that lol Edited by AnnieRuru
  • Upvote 1
Posted

tq annie

sory for bump!!

this is mys script use tutor from annie.

- script Race_system -1,{

OnPCLoginEvent:

if (strcharinfo(4) == "Hades")

savepoint "Gonryun",159,158;

if (strcharinfo(4) == "Athena")

savepoint "Lighthalzen",159,90;

if (strcharinfo(4) == "")

savepoint "izlude",94,103;

OnPCDieEvent:

atcommand "@raise";

if(strcharinfo(4) == "Hades")

warp "Gonryun",159,158;

if (strcharinfo (4) == "Athena")

warp "Lighalzen",159,90;

if (strcharinfo (4) == "")

warp "Izlude",94,103;

//[...]

}

it's correct?after test on my server it's does'nt warp..and after character die my character doesn't raise and doesn't warp?

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