Mapname Selft Announcer

joven15

New member
Messages
152
Points
0
Can anyone help me please.

4iekuw.jpg


- script Sample -1,{
OnInit:
setarray .Map$, // <mapname>,<Map Nick>,
 
"c_tower3_","Clock Tower, 3nd Floor",
"artz_pvp","TrivalRO PVP";
 
for( set .i,0; .i < getarraysize( .Map$ ) - 1; set .i,.i + 2 )
setmapflag .Map$[.i],mf_loadevent;
end;
 
OnPCLoadMapEvent:
for( set .i,0; .i < getarraysize( .Map$ ) - 1; set .i,.i + 2 )
if( strcharinfo(3) == .Map$[.i] )
announce "You entered map : "+.Map$[.i+1]+" .",bc_self;
end;
}
 
Code:
-	script	Sample	-1,{	OnInit:		setarray .Maps$[0], "prontera","Prontera Midgard",							"payon","Payon Forest";		.size = getarraysize( .Maps$ );		for ( .@i = 0; .@i < .size; .@i += 2 )			setmapflag .Maps$[ .@i ], mf_loadevent;		end;	OnPCLoadMapEvent:		getmapxy( .@map$, .@x, .@y, 0 );		for ( .@i = 0; .@i < .size; .@i += 2 ) {			if ( .@map$ == .Maps$[ .@i ] )			announce "You entered map : " + .Maps$[ .@i + 1 ] + ".",bc_self;		}		end;}
 
Still the same the error on my first post.

- script Sample -1,{
OnInit:
setarray .Maps$[0], "prontera","Prontera Midgard",
"payon","Payon Forest";
.size = getarraysize( .Maps$ );
for ( .@i = 0; .@i < .size; .@i += 2 )
setmapflag .Maps$[ .@i ], mf_loadevent;
end;
OnPCLoadMapEvent:
getmapxy( .@map$, .@x, .@y, 0 );
for ( .@i = 0; .@i < .size; .@i += 2 ) {
if ( .@map$ == .Maps$[ .@i ] )
announce "You entered map : " + .Maps$[ .@i + 1 ] + ".",bc_self;
}
end;
}
 
seems like the encoding of your txt file is messed up
default_tongue.png
try to create a new file and paste it

 
I have same script like this and it's working only on my 2 custom maps, other map like prontera, morroc etc it doesn't announce the name of the map please check thanks..

here's the script.. help please!

- script where_am_i -1,{
OnPCLoadMapEvent:
set .@map$, replacestr(replacestr(strcharinfo(3), "@","_"), "-","_");
if (getd("."+.@map$+"$") != "")
  announce " [ " + getd("."+.@map$+"$") + " ] ",bc_self,;
end;

OnInit:

set .prontera$, "Prontera City, Capital of Rune Midgard";
set .morocc$, "Morroc Town";
set .06guild_03$, "Guild War Arena";
set .06guild_04$, "Guild War Arena";

end

}
Thanks!

 
Last edited by a moderator:
I have same script like this and it's working only on my 2 custom maps, other map like prontera, morroc etc it doesn't announce the name of the map please check thanks..

here's the script.. help please!

- script where_am_i -1,{

OnPCLoadMapEvent:

set .@map$, replacestr(replacestr(strcharinfo(3), "@","_"), "-","_");

if (getd("."+.@map$+"$") != "")

  announce " [ " + getd("."+.@map$+"$") + " ] ",bc_self,;

end;

OnInit:

set .prontera$, "Prontera City, Capital of Rune Midgard";

set .morocc$, "Morroc Town";

set .06guild_03$, "Guild War Arena";

set .06guild_04$, "Guild War Arena";

end

}
Thanks!
do those maps got loadevent mapflag?

 
I have same script like this and it's working only on my 2 custom maps, other map like prontera, morroc etc it doesn't announce the name of the map please check thanks..

here's the script.. help please!

- script where_am_i -1,{

OnPCLoadMapEvent:

set .@map$, replacestr(replacestr(strcharinfo(3), "@","_"), "-","_");

if (getd("."+.@map$+"$") != "")

  announce " [ " + getd("."+.@map$+"$") + " ] ",bc_self,;

end;

OnInit:

set .prontera$, "Prontera City, Capital of Rune Midgard";

set .morocc$, "Morroc Town";

set .06guild_03$, "Guild War Arena";

set .06guild_04$, "Guild War Arena";

end

}
Thanks!
do those maps got loadevent mapflag?
before im using old hercules rev. and it's working properly.. now im using the latest..

where to see loadevent for every town? and where will i put that?

 
Last edited by a moderator:
Please don't save your scripts on UTF encoding, this is what causes these problems since first characters added on an UTF encoded files is the Byte-Order Mask (BOM).

Try saving your scripts with ANSI encoding or as UTF without BOM and try loading your script again.

You can know more about the BOM if you go look more information about the UTF file standard on Wikipedia.

 
Please don't save your scripts on UTF encoding, this is what causes these problems since first characters added on an UTF encoded files is the Byte-Order Mask (BOM).

Try saving your scripts with ANSI encoding or as UTF without BOM and try loading your script again.

You can know more about the BOM if you go look more information about the UTF file standard on Wikipedia.
WOW YOUR RIGHT..... THANK YOU VERY MUCH> YOU SOLVED MY PROBLEM
default_sad.png
:( ANY THANKS ALSO TO YOU EVIL PUNKER. 

 
Please don't save your scripts on UTF encoding, this is what causes these problems since first characters added on an UTF encoded files is the Byte-Order Mask (BOM).

Try saving your scripts with ANSI encoding or as UTF without BOM and try loading your script again.

You can know more about the BOM if you go look more information about the UTF file standard on Wikipedia.
btw i got some error.

[Error]: run_script: inifity loop !
[Debug] Source (NPC): Announcer (inivisible/not on a map)
 
can u help me how to fix it?
 
which script are you using? the one of the first post or the second one?

 
Put freeloop(1); before the loops and freeloop(0); after them.

 
Back
Top