Jump to content
  • 0

my script doesn't auto warp?


kangfredy

Question


  • Group:  Members
  • Topic Count:  112
  • Topics Per Day:  0.03
  • Content Count:  388
  • Reputation:   4
  • Joined:  05/01/12
  • Last Seen:  

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;

}

Link to comment
Share on other sites

11 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

OnPCDieEvent

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  205
  • Reputation:   19
  • Joined:  10/12/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  112
  • Topics Per Day:  0.03
  • Content Count:  388
  • Reputation:   4
  • Joined:  05/01/12
  • Last Seen:  

thanks guys :) but why my script doesn't auto warp??

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

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");

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

@Annie

perhap he is using somekind of Faction system....like this..

http://rathena.org/board/topic/64816-beta-2-faction-system/page__hl__faction

*strcharinfo(4);
return faction name.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  112
  • Topics Per Day:  0.03
  • Content Count:  388
  • Reputation:   4
  • Joined:  05/01/12
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  112
  • Topics Per Day:  0.03
  • Content Count:  388
  • Reputation:   4
  • Joined:  05/01/12
  • Last Seen:  

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?

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

try this..

http://pastebin.com/raw.php?i=EMTUuRDm

beside....map name are not suppose to have capital letters...

for the revive process....you have to give a short delay before it run the atcommand...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  112
  • Topics Per Day:  0.03
  • Content Count:  388
  • Reputation:   4
  • Joined:  05/01/12
  • Last Seen:  

try this..

http://pastebin.com/raw.php?i=EMTUuRDm

beside....map name are not suppose to have capital letters...

for the revive process....you have to give a short delay before it run the atcommand...

ok tq emistry it's work...:D...sorry correct for ur script it must "lighthalzen" not "lighalzen" ..thank you so much :D.wkwkwkwkkw

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

×
×
  • Create New...