Jump to content
  • 0

What's wrong with my script?


Lord Ganja

Question


  • Group:  Members
  • Topic Count:  141
  • Topics Per Day:  0.03
  • Content Count:  444
  • Reputation:   22
  • Joined:  06/18/12
  • Last Seen:  

Hi. Can anyone check this script? It's not working fine with me..

My only problem here is it doesn't kick the party member when the party member logged out.

But if the party member changed map, the script is triggered.

 

Does this script still continue to run even when the player logged out?

Since I didnt put an 'end;' at OnPCLogoutEvent, it should continue run until OnPCStatCalcEvent right?  But doesn't work for me.

OnPCLogoutEvent:
    if( @insta_event )
        .@logged = 1;
OnPCStatCalcEvent:
    if( @insta_event ) { .............
........................

Here's the full script:

-	script	custom_event_checker	-1,{
OnPCLoadMapEvent:
getmapxy(.@map$,.@x,.@y,0);
	if( .@map$ == "guild_vs2-2"
	 || .@map$ == "ph_dun01" 
	 || .@map$ == "ph_dun02"
	 || .@map$ == "ph_dun03" ) {
		if(getgmlevel() > 0 && getgmlevel() < 99) {
			atcommand "@storeall";
			atcommand "@job novice";
			atcommand "@adjgroup 30";
			end;
		} else {
		atcommand "@autoloot 100";
		@insta_event = 1;
		end;
		}
	}
	end;

OnPCLogoutEvent:
	if( @insta_event )
		.@logged = 1;
OnPCStatCalcEvent:
	if( @insta_event ) {
		if ( strcharinfo(3) == "ph_dun01" && !.@logged
		||   strcharinfo(3) != "ph_dun01" && .@logged
		||   strcharinfo(3) == "ph_dun02" && !.@logged
		||   strcharinfo(3) != "ph_dun02" && .@logged
		||   strcharinfo(3) == "ph_dun03" && !.@logged
		||   strcharinfo(3) != "ph_dun03" && .@logged
		||   strcharinfo(3) == "guild_vs2-2" && !.@logged
		||   strcharinfo(3) != "guild_vs2-2" && .@logged
		||   getcharid(1) == 0 ) end;
		.@party_id = getcharid(1);
		if ( getcharid(0) != getpartyleader( .@party_id, 2 ) )
			party_delmember();
		else {
			.i = 0;
			if ( instance_check_party(.@party_id,2) == 0 )
				party_destroy(.@party_id);
			else {
				addrid( 2, 0, .@party_id );
				if( !.i && !.@party_id ) {
					.i = 1;
					party_changeleader getcharid(1), getcharid(0);
				} else if( .@party_id )
					party_delmember();
			}
		}
		@insta_event = 0;
	}
	end;
}
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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