loadmapevent help.

vBrenth

New member
Messages
392
Points
0
Age
35
Location
Philippines
Discord
Brenth
Github
vBrenth
Emulator
Client Version
RE
I'm not sure whats the problem of this script but when i enter prtg_cas03 one of the map on the list it loads the script multiple times like how many maps flagged as loadmap maflag

-  script  Anti_Assump  -1,{OnInit:setarray .map$[0],"prtg_cas03","gefg_cas04","payg_cas03","schg_cas01","guild_vs1";for( set .@i,0; .@i < getarraysize( .map$ ); set .@i,.@i + 1 ){  setd( ".map_"+.map$[.@i] ),1;  setmapflag .map$[.@i],mf_loadevent;}end;OnPCLoadMapEvent:while( getd( ".map_"+strcharinfo(3) ) ){  sc_end SC_ASSUMPTIO;  message strcharinfo(0),"The assumption buff are disable in GvG/WoE maps.";}end;} 


2j48075.jpg


Its spam alot like this..

"The assumption buff are disable in GvG/WoE maps.";
 
Last edited by a moderator:
OnPCLoadMapEvent:
while( getd( ".map_"+strcharinfo(3) ) ){
 sc_end SC_ASSUMPTIO;
 message strcharinfo(0),"The assumption buff are disable in GvG/WoE maps.";

   end;
}
end;
}

 
May I ask what's the point in while if it's supposed to run only once on entrance?

 
No, I mean why use *while cycle if simple *if is enough for checking that condition.

 
this should work

Code:
-	script	Anti_Assump	-1,{OnInit:	setarray .@map$[0],"prtg_cas03","gefg_cas04","payg_cas03","schg_cas01","guild_vs1";	.@size = getarraysize( .@map$ );	for ( .@i = 0; .@i < .@size; .@i++ ) {		setd ".map_"+ .@map$[.@i], true;		setmapflag .@map$[.@i], mf_loadevent;	}	end;OnPCLoadMapEvent:	if ( getd( ".map_"+ strcharinfo(3) ) && getstatus(SC_ASSUMPTIO) ) {		sc_end SC_ASSUMPTIO;		message strcharinfo(0), "Assumptio buff are disable in GvG/WoE maps.";	}	end;}
 
Last edited by a moderator:
~> awwww removed.

 
Last edited by a moderator:
Thank you annie
default_biggrin.png
but i am also having problem with one of my script it spam as well too..

http://pastebin.com/HUkQiKH

v7v2g.jpg


This one spam the onloadmap too >.>

Line 48; when loadmapevents trigger it buffs like the total of map as marked as loadmap

 
Last edited by a moderator:
I noticed at the beginning of the script, there are *mes script commands

so I guess you didn't post the duplicate npc part

of course it will spam the dialog because you duplicated the OnPCLoadMapEvent labels multiple times

change this

Code:
-	script	Buff	-1,{	mes "hi";	close;OnPCLoadMapEvent:	buffing....	end;}prontera,x,y,z	duplicate(Buff)	Buff#1	100izlude,x,y,z	duplicate(Buff)	Buff#2	100geffen,x,y,z	duplicate(Buff)	Buff#3	100
into this
Code:
-	script	Buff	-1,{	mes "hi";	close;}-	script	Buff#main	-1,{OnPCLoadMapEvent:	buffing....	end;}prontera,x,y,z	duplicate(Buff)	Buff#1	100izlude,x,y,z	duplicate(Buff)	Buff#2	100geffen,x,y,z	duplicate(Buff)	Buff#3	100
so the OnPCLoadMapEvent doesn't get duplicated
 
Last edited by a moderator:
Thanks anniieee
default_biggrin.png


 
Last edited by a moderator:
Back
Top