Sign in to follow this  
Madeon

Error con Script de Anuncio

Recommended Posts

Buenas chicos y chicas, Por que cuando mato un monstruo que esta fuera de la lista de este script me tira el siguiente error en la consola -- Script hecho por Mabuhay (sin testear)

 

-	script	mvp_announce	-1,{
OnInit:
    setarray .mobid, 1002, 1001;
    setarray .map$, "prt_fild08", "prontera";
    end;

OnNPCKillEvent:
    [email protected] = inarray(.mobid[0], killedrid );
    if ( strcharinfo(3) == .map$[[email protected]] ) {
		announce "["+ strcharinfo(0) +"] ha matado "+ getmonsterinfo( killedrid, MOB_NAME ) +" en el mapa "+ strcharinfo(3) +".", bc_all;
    }
}

 

Error

[Warning]: script:getelementofarray: index out of range (-1)
[Debug]: Data: variable name='.map$' index=0
[Debug]: Source (NPC): jklasdf (invisible/not on a map)

Share this post


Link to post
Share on other sites
1 hour ago, sader1992 said:
if ([email protected] != -1 && strcharinfo(3) == .map$[[email protected]] ) {

 

[Warning]: script:getelementofarray: index out of range (-1)
[Debug]: Data: variable name='.map$' index=0
[Debug]: Source (NPC): mvp_announce (invisible/not on a map)

Aun sigue tirando error

Share this post


Link to post
Share on other sites

try

-	script	mvp_announce	-1,{
OnInit:
    setarray .mobid, 1002, 1001;
    setarray .map$, "prt_fild08", "prontera";
    end;

OnNPCKillEvent:
	if(([email protected] = inarray(.mobid[0], killedrid )) != -1){
		if ( strcharinfo(3) == .map$[[email protected]] ) {
			announce "["+ strcharinfo(0) +"] ha matado "+ getmonsterinfo( killedrid, MOB_NAME ) +" en el mapa "+ strcharinfo(3) +".", bc_all;
		}
	}
    
}

 

Share this post


Link to post
Share on other sites

Si gustas también puedes probar este.

-	script	#mvp_announcer	-1,{

OnInit:
//	.gmp = 40;  // Nivel de GM para preever anuncio.
	// Lista de Mapas de MVP.
	setarray .t_maps$[0],"moc_pryd06","lhz_dun03","gld2_prt","abbey02","ayo_dun02","lhz_dun04","ra_fild02","xmas_fild01","dic_dun02","beach_dun","iz_dun05","tur_dun04","lhz_dun02","jupe_core","moc_fild22","anthell02","odin_tem03","gon_dun03","gef_fild02","thana_boss","gef_fild10","ein_dun02","gef_fild14","moc_pryd04","dew_dun01","in_sphinx5","niflheim","moc_fild17","xmas_dun02","ice_dun03","kh_dun02","treasure02","moc_prydn2","pay_dun04","ra_san05","mosk_dun03","ama_dun03","thor_v03","gef_dun01","mjolnir_04","abyss_03","dic_dun03","prt_sewb4","pay_fild11","gef_dun02","gl_chyard","ra_fild03","ra_fild04","ve_fild01","ve_fild02","lou_dun03","prt_maze03","bra_dun02";
	end;

OnNPCKillEvent:
//if (getgmlevel() >= .gmp ) end;
if ( getmonsterinfo( killedrid, MOB_MVPEXP )) {
	for ([email protected] = 0; [email protected] < getarraysize(.t_maps$); [email protected]++) {
	if ( strcharinfo(3) == .t_maps$[[email protected]]) { 
			if ( getcharid(1) ) {
				getpartymember getcharid(1), 1;
				getpartymember getcharid(1), 2;
				for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ) {
					if ( isloggedin( [email protected][[email protected]], [email protected][[email protected]] ) ) { 
						[email protected][[email protected]] = [email protected][[email protected]];
						[email protected]++;
					}
				}
				announce "[ System ] : Player ["+ strcharinfo(0) +"] of party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), bc_all;
			}
			else {
				announce "[ System ] : Player ["+ strcharinfo(0) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" alone at "+ strcharinfo(3), bc_all;
			}
	end;
	}
	}
}	
}

Aquí modifica los mapas en los que se encuentran los mvps que contarán:

setarray .t_maps$[0],"moc_pryd06","lhz_dun03","gld2_prt","abbey02","ayo_dun02","lhz_dun04","ra_fild02","xmas_fild01","dic_dun02","beach_dun","iz_dun05","tur_dun04","lhz_dun02","jupe_core","moc_fild22","anthell02","odin_tem03","gon_dun03","gef_fild02","thana_boss","gef_fild10","ein_dun02","gef_fild14","moc_pryd04","dew_dun01","in_sphinx5","niflheim","moc_fild17","xmas_dun02","ice_dun03","kh_dun02","treasure02","moc_prydn2","pay_dun04","ra_san05","mosk_dun03","ama_dun03","thor_v03","gef_dun01","mjolnir_04","abyss_03","dic_dun03","prt_sewb4","pay_fild11","gef_dun02","gl_chyard","ra_fild03","ra_fild04","ve_fild01","ve_fild02","lou_dun03","prt_maze03","bra_dun02";

Nota: Como no sé que modo estas utilizando "RE o PRE" ahí puedes ir eligiendo a tu gusto. Para que funcione todo perfectamente te recomendaría poner mapflag de uso de bloody branch en esos maps 😉 claro es una sugerencia.

Para activar la función para GMs solo descomenta estos:

//	.gmp = 40;  // Nivel de GM para preever anuncio.
//if (getgmlevel() >= .gmp ) end;

Créditos a @pajodex por el script, yo solo removí algunas funciones y lo convertí solo en anunciador.

 

Edited by Mael
complementar información

Share this post


Link to post
Share on other sites

Gracías  Mael y sader1992... Usare el siguiente que es más facil de entender y editar.

 

1 hour ago, Mael said:

Si gustas también puedes probar este.

-	script	#mvp_announce	-1,{

OnInit:
//	.gmp = 40;  // Nivel de GM para preever anuncio.
	// Lista de Mapas de MVP.
	setarray .t_maps$[0],"moc_pryd06","lhz_dun03","gld2_prt","abbey02","ayo_dun02","lhz_dun04","ra_fild02","xmas_fild01","dic_dun02","beach_dun","iz_dun05","tur_dun04","lhz_dun02","jupe_core","moc_fild22","anthell02","odin_tem03","gon_dun03","gef_fild02","thana_boss","gef_fild10","ein_dun02","gef_fild14","moc_pryd04","dew_dun01","in_sphinx5","niflheim","moc_fild17","xmas_dun02","ice_dun03","kh_dun02","treasure02","moc_prydn2","pay_dun04","ra_san05","mosk_dun03","ama_dun03","thor_v03","gef_dun01","mjolnir_04","abyss_03","dic_dun03","prt_sewb4","pay_fild11","gef_dun02","gl_chyard","ra_fild03","ra_fild04","ve_fild01","ve_fild02","lou_dun03","prt_maze03","bra_dun02";
	end;

OnNPCKillEvent:
//if (getgmlevel() >= .gmp ) end;
if ( getmonsterinfo( killedrid, MOB_MVPEXP )) {
	for ([email protected] = 0; [email protected] < getarraysize(.t_maps$); [email protected]++) {
	if ( strcharinfo(3) == .t_maps$[[email protected]]) { 
			if ( getcharid(1) ) {
				getpartymember getcharid(1), 1;
				getpartymember getcharid(1), 2;
				for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ) {
					if ( isloggedin( [email protected][[email protected]], [email protected][[email protected]] ) ) { 
						[email protected][[email protected]] = [email protected][[email protected]];
						[email protected]++;
					}
				}
				announce "[ System ] : Player ["+ strcharinfo(0) +"] of party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), bc_all;
			}
			else {
				announce "[ System ] : Player ["+ strcharinfo(0) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" alone at "+ strcharinfo(3), bc_all;
			}
	end;
	}
	}
}	
}

Aquí modifica los mapas en los que se encuentran los mvps que contarán:

setarray .t_maps$[0],"moc_pryd06","lhz_dun03","gld2_prt","abbey02","ayo_dun02","lhz_dun04","ra_fild02","xmas_fild01","dic_dun02","beach_dun","iz_dun05","tur_dun04","lhz_dun02","jupe_core","moc_fild22","anthell02","odin_tem03","gon_dun03","gef_fild02","thana_boss","gef_fild10","ein_dun02","gef_fild14","moc_pryd04","dew_dun01","in_sphinx5","niflheim","moc_fild17","xmas_dun02","ice_dun03","kh_dun02","treasure02","moc_prydn2","pay_dun04","ra_san05","mosk_dun03","ama_dun03","thor_v03","gef_dun01","mjolnir_04","abyss_03","dic_dun03","prt_sewb4","pay_fild11","gef_dun02","gl_chyard","ra_fild03","ra_fild04","ve_fild01","ve_fild02","lou_dun03","prt_maze03","bra_dun02";

Nota: Como no sé que modo estas utilizando "RE o PRE" ahí puedes ir eligiendo a tu gusto. Para que funcione todo perfectamente te recomendaría poner mapflag de uso de bloody branch en esos maps 😉 claro es una sugerencia.

Para activar la función para GMs solo descomenta estos:

//	.gmp = 40;  // Nivel de GM para preever anuncio.
//if (getgmlevel() >= .gmp ) end;

Créditos a @pajodex por el script, yo solo removí algunas funciones y lo convertí solo en anunciador.

 

 

Edited by Madeon

Share this post


Link to post
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
Reply to this topic...

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

Sign in to follow this