Jump to content
  • 0

OnPCLoadMapEvent cannot be used in 2 different scripts


iconrag

Question


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.01
  • Content Count:  5
  • Reputation:   0
  • Joined:  09/03/22
  • Last Seen:  

hello guys, i have a problem with OnPCLoadMapEvent
so. one of my script is this one removing status effect in GVG Map ( aldeg_cas01, etc )
 

-	script	remove_assumptio	-1,{
OnPCLoadMapEvent:
		sc_end SC_MINDBREAKER;
		sc_end SC_ASSUMPTIO;
		sc_end SC_SPIRIT;
	end;
}

aldeg_cas01	mapflag	loadevent
aldeg_cas02	mapflag	loadevent
aldeg_cas03	mapflag	loadevent

and the other one is this on pvp ladder NPC Script

 

OnPCLoadMapEvent:
	if ( @dota_sql_kills == 0 && @dota_sql_deaths == 0 ) {
		if ( .maptrigger$ != "all" ) {
			getmapxy .@map$, .@x, .@y, 1;
			for ( set .@i, 0; .@i < .maptriggersize; set .@i, .@i +1 ) {
				if ( .@map$ == .maptrigger$[.@i] ) break;
			}
			if ( .@i == .maptriggersize ) end;
		}
		query_sql "select kills, deaths, streaks, unix_timestamp(streaktime) from pvpladder where char_id = "+ getcharid(0), @dota_sql_kills, @dota_sql_deaths, @dota_sql_streaks, @dota_sql_streaktime;
	}
	if ( getcharid(2) && getd(".dota_sql_"+ getcharid(2) +"_h") == 0 ) {
		query_sql "select currentown, highestown, unix_timestamp(owntime) from ownladder where guild_id = "+ getcharid(2), .@c, .@h, .@t;
		setd ".dota_sql_"+ getcharid(2) +"_c", .@c;
		setd ".dota_sql_"+ getcharid(2) +"_h", .@h;
		setd ".dota_sql_"+ getcharid(2) +"_t", .@t;
	}
	end;
}

pvp_y_2-2	mapflag	loadevent


The problem is, The pvp_y_2-2 Map now reads OnPCLoadMapEvent that removes status effect, so when players enters pvp_y_2-2. the assumpio, spirit, and mind breaker is removed

Can someone please help? thank you !

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  41
  • Reputation:   11
  • Joined:  11/17/20
  • Last Seen:  

4 hours ago, iconrag said:

hello guys, i have a problem with OnPCLoadMapEvent
so. one of my script is this one removing status effect in GVG Map ( aldeg_cas01, etc )
 

-	script	remove_assumptio	-1,{
OnPCLoadMapEvent:
		sc_end SC_MINDBREAKER;
		sc_end SC_ASSUMPTIO;
		sc_end SC_SPIRIT;
	end;
}

aldeg_cas01	mapflag	loadevent
aldeg_cas02	mapflag	loadevent
aldeg_cas03	mapflag	loadevent

and the other one is this on pvp ladder NPC Script

 

OnPCLoadMapEvent:
	if ( @dota_sql_kills == 0 && @dota_sql_deaths == 0 ) {
		if ( .maptrigger$ != "all" ) {
			getmapxy .@map$, .@x, .@y, 1;
			for ( set .@i, 0; .@i < .maptriggersize; set .@i, .@i +1 ) {
				if ( .@map$ == .maptrigger$[.@i] ) break;
			}
			if ( .@i == .maptriggersize ) end;
		}
		query_sql "select kills, deaths, streaks, unix_timestamp(streaktime) from pvpladder where char_id = "+ getcharid(0), @dota_sql_kills, @dota_sql_deaths, @dota_sql_streaks, @dota_sql_streaktime;
	}
	if ( getcharid(2) && getd(".dota_sql_"+ getcharid(2) +"_h") == 0 ) {
		query_sql "select currentown, highestown, unix_timestamp(owntime) from ownladder where guild_id = "+ getcharid(2), .@c, .@h, .@t;
		setd ".dota_sql_"+ getcharid(2) +"_c", .@c;
		setd ".dota_sql_"+ getcharid(2) +"_h", .@h;
		setd ".dota_sql_"+ getcharid(2) +"_t", .@t;
	}
	end;
}

pvp_y_2-2	mapflag	loadevent


The problem is, The pvp_y_2-2 Map now reads OnPCLoadMapEvent that removes status effect, so when players enters pvp_y_2-2. the assumpio, spirit, and mind breaker is removed

Can someone please help? thank you !

just mention the maps u want this script to work

-	script	remove_assumptio	-1,{
OnPCLoadMapEvent:
		if(strcharinfo(3)=="aldeg_cas01" || strcharinfo(3)=="aldeg_cas02" strcharinfo(3)=="aldeg_cas03") {
		sc_end SC_MINDBREAKER;
		sc_end SC_ASSUMPTIO;
		sc_end SC_SPIRIT;
	end;
}
}
Edited by Pride
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.01
  • Content Count:  147
  • Reputation:   36
  • Joined:  05/15/20
  • Last Seen:  

2 hours ago, iconrag said:
-	script	remove_assumptio	-1,{
OnPCLoadMapEvent:
		sc_end SC_MINDBREAKER;
		sc_end SC_ASSUMPTIO;
		sc_end SC_SPIRIT;
	end;
}

Just remove the end; in this script so it will continue the script and make sure this script will load first before the PVP Script.

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