Jump to content
  • 0
Tsuuu

Array start position 1

Question

Hello, good afternoon, someone could help me in this script ?

good, I caught a CP IN Game and added an option to reset position of character, but when the menu appears for selection of characters something is wrong, when I select the first character it returns me the second and when I select the last in the list it returns me null, ie my repetition structure is in the index with a value more...

 

I do not know how to solve this , someone could give me some tips please ?

 

Ps: My english is bad but i understand with help of translater.

Ps²: I'm sorry if I was not clear in the words, I am willing to provide any iformação in the code for better understanding

 

query_sql "SELECT `name` FROM `char` WHERE `account_id` = '"+getcharid(3)+"'",@chars$;

case 3:
		
	next;
	mes .cp$;
	mes "Selecione qual personagem você deseja resetar posição";
	next;
			
	switch(select("Escolher Personagem")) {
		case 1:
			for (.@i = 1; .@i < getarraysize(@chars$); .@i++) {   //Here I ride the menu
				.@menu$ = .@menu$ +" "+ @chars$[.@i];
				.@menu$ = .@menu$ + ":";
			}
					
			.@escolha = select(.@menu$);
					
			.@char$ = @chars$[.@escolha];
					
		break;
	}
			
	mes .cp$;
	mes "Deseja resetar a posição do personagem ^0000ff"+.@char$+"^000000?"; //Here I see that the return value is 1 more
	next;
	if (select("- ^0000ffSim^000000:- Não") == 2)
		close;
	query_sql "UPDATE `char` SET `last_map` = 'prontera', `last_x` = 50, `last_y` = 50 WHERE `name` = '"+.@char$+"'";
	mes .cp$;
	mes "Posição resetada !";
	close;
Edited by Tsuuu

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0


query_sql "SELECT `name` FROM `char` WHERE `account_id` = '"+getcharid(3)+"'",@chars$;

case 3:

next;

mes .cp$;

mes "Selecione qual personagem você deseja resetar posição";

next;

switch(select("Escolher Personagem")) {

case 1:

for (.@i = 0; .@i < getarraysize(@chars$); .@i++) { //Here I ride the menu

.@menu$ = .@menu$ +" "+ @chars$[.@i];

.@menu$ = .@menu$ + ":";

}

.@escolha = select(.@menu$)-1;

.@char$ = @chars$[.@escolha];

break;

}

mes .cp$;

mes "Deseja resetar a posição do personagem ^0000ff"+.@char$+"^000000?"; //Here I see that the return value is 1 more

next;

if (select("- ^0000ffSim^000000:- Não") == 2)

close;

query_sql "UPDATE `char` SET `last_map` = 'prontera', `last_x` = 50, `last_y` = 50 WHERE `name` = '"+.@char$+"'";

mes .cp$;

mes "Posição resetada !";

close;

Share this post


Link to post
Share on other sites
  • 0

Holy shit , thank you, how can this, i need to study more, i did not realize ,.

 

Problem solved, God bless you !

 

 

@edit

 

Script working perfectly here  \/

 

 

 

//==============================================================//
//   _    _ _____     _____           _       _                 //
//  | |  | |  __ \   / ____|         (_)     | |                //
//  | |__| | |  | | | (___   ___ _ __ _ _ __ | |_ ___           //
//  |  __  | |  | |  \___ \ / __| '__| | '_ \| __/ __|          //
//  | |  | | |__| |  ____) | (__| |  | | |_) | |_\__ \          //
//  |_|  |_|_____/  |_____/ \___|_|  |_| .__/ \__|___/          //
//   Hurican Dooders Script's ™        | |                      //
//                                     |_|                      //
//                                                              //
// Painel de Controle de Contas		                        //
// Versão 1.0                        //
//==============================================================//

prontera,150,150,5	script	Painel de Controle#HD	89,{

//================ Configurações ===============================//

set .cp$,"[^EE0000Painel de Controle^000000]";
set .menu$,"^FFA500•^000000";
if(gettime(3) <= 18)
		{
	 		set .hr$,"om dia";
		}
	else
		{
			set .hr$,"oa noite";
		}

//================ Banco de Dados ==============================//
	query_sql "SELECT `user_pass` FROM `login` WHERE `account_id` = '"+getcharid(3)+"'",@password$;
	query_sql "SELECT `email` FROM `login` WHERE `account_id` = '"+getcharid(3)+"'",@email$;
	query_sql "SELECT `logincount` FROM `login` WHERE `account_id` = '"+getcharid(3)+"'",@logou$;
	query_sql "SELECT `group_id` FROM `login` WHERE `account_id` = '"+getcharid(3)+"'",@nivel$;
	query_sql "SELECT `name` FROM `char` WHERE `account_id` = '"+getcharid(3)+"'",@chars$;
//==============================================================//

	mes .cp$;
	mes "B"+.hr$+", "+strcharinfo(0);
	mes "Sou o assistente de contas.";
	mes "Aqui você poderá trocar sua senha, seu e-mail, resetar posição e deletar alguns itens do seu inventário.";
	mes "Me diga o que você precisa.";
	mes " ";
	mes "Senha atual: ^BF3EFF"+@password$+"^000000";
	mes "E-mail atual: ^BF3EFF"+@email$+"^000000";
	switch(select(""+.menu$+" Trocar minha senha:"+.menu$+" Trocar meu e-mail:"+.menu$+" Resetar Posição:"+.menu$+" Deletar item:"+.menu$+" Estatísticas da minha Conta:"+.menu$+" Nada"))
	{
		case 1:
			next;
			mes .cp$;
			mes "Sua senha atual é: ^BF3EFF"+@password$+"^000000";
			mes "Deseja mesmo troca-la?";
			if(select(""+.menu$+" Sim:"+.menu$+" Não") == 2)
				{
					next;
					mes .cp$;
					mes "Tudo bem então, tenha um(a) b"+.hr$+"!";
					close;
				}
			next;
			mes .cp$;
			mes "Ok então, digite a sua nova senha.";
			next;
			input .senha$;
			mes .cp$;
			mes "Sua nova senha é: ^BF3EFF"+.senha$+"^000000, está certo disso?";
			if(select(""+.menu$+" Sim:"+.menu$+" Não") == 2)
				{
					next;
					mes .cp$;
					mes "Tudo bem então, tenha um(a) b"+.hr$+"!";
					close;
				}
			next;
			query_sql "UPDATE `login` SET `user_pass` = '"+.senha$+"' WHERE `account_id` = '"+getcharid(3)+"'";
			mes .cp$;
			mes "Agora sua nova senha é: ^BF3EFF"+.senha$+"^000000";
			next;
			mes .cp$;
			mes "Obrigado por usar os meus serviços.";
			close;

		case 2:
			next;
			mes .cp$;
			mes "Seu e-mail atual é: ^BF3EFF"+@email$+"^000000";
			mes "Deseja mesmo troca-lo?";
			if(select(""+.menu$+" Sim:"+.menu$+" Não") == 2)
				{
					next;
					mes .cp$;
					mes "Tudo bem então, tenha um(a) b"+.hr$+"!";
					close;
				}
			next;
			mes .cp$;
			mes "Ok então, digite seu novo e-mail.";
			next;
			input .mail$;
			mes .cp$;
			mes "Seu novo e-mail é: ^BF3EFF"+.mail$+"^000000, está certo disso?";
			if(select(""+.menu$+" Sim:"+.menu$+" Não") == 2)
				{
					next;
					mes .cp$;
					mes "Tudo bem então, tenha um(a) b"+.hr$+"!";
					close;
				}
			next;
			query_sql "UPDATE `login` SET `email` = '"+.mail$+"' WHERE `account_id` = '"+getcharid(3)+"'";
			mes .cp$;
			mes "Agora seu novo e-mail é: ^BF3EFF"+.mail$+"^000000";
			next;
			mes .cp$;
			mes "Obrigado por usar os meus serviços.";
			close;
			
		case 3:
		
			next;
			mes .cp$;
			mes "Selecione qual personagem você deseja resetar posição";
			next;
			
			switch(select("Escolher Personagem")) {
				case 1:
					for (.@i = 0; .@i < getarraysize(@chars$); .@i++) {
						.@menu$ = .@menu$ +" "+ @chars$[.@i];
						.@menu$ = .@menu$ + ":";
					}
					
					.@escolha = select(.@menu$)-1;
					
					.@char$ = @chars$[.@escolha];
					
				break;
			}
			
			mes .cp$;
			mes "Deseja resetar a posição do personagem ^0000ff"+.@char$+"^000000?";
			next;
			query_sql "SELECT `last_map` FROM `char` WHERE `name` = '"+.@char$+"'",@prison$;				
			if (@prison$ != "sec_pri"){
				
				if (select("- ^0000ffSim^000000:- Não") == 2)
					close;
				
					query_sql "UPDATE `char` SET `last_map` = 'prontera', `last_x` = 50, `last_y` = 50 WHERE `name` = '"+.@char$+"'";
					mes .cp$;
					mes "Posição resetada !";
					close;
			}else{			
				mes .cp$;
				mes "Voce não pode resetar a posição de um personagem que está preso.";
				close;
			}
		case 4:
			next;
			mes .cp$;
			mes "Bom, para deletar seu item bugado, deixe apenas ele no seu inventário.";
			mes "Tudo certo então? Posso deletar seu item?";
			if(select(""+.menu$+" Sim:"+.menu$+" Não") == 2)
				{
					next;
					mes .cp$;
					mes "Tudo bem então, tenha um(a) b"+.hr$+"!";
					close;
				}
			next;
			atcommand "@itemreset";
			mes .cp$;
			mes "Feito, seu item foi deletado com sucesso.";
			close;

		case 5:
			next;
			mes .cp$;
			mes "Vejo em meu sistema, que você já logou "+@logou$+" vezes nessa conta.";
			next;
			mes .cp$;
			mes "Vejo também, que você logou "+logou+" vezes neste char.";
			next;
			mes .cp$;
			if(getgmlevel() >= 1)
				{
					if(#CASHPOINTS >= 1)
						{
							mes "Sua conta é VIP e possui "+#CASHPOINTS+" Cashs.";
							close;
						}
					mes "Sua conta é VIP e não possui Cashs.";
					close;
				}
			if(#CASHPOINTS >= 1)
				{
					mes "Sua conta não é VIP e possui "+#CASHPOINTS+" Cashs.";
					close;
				}
			mes "Sua conta não é VIP e não possui Cashs.";
			close;
			
		case 6:
			next;
			mes .cp$;
			mes "Tudo bem então, tenha um(a) b"+.hr$+"!";
			close;
	}
//==== Estatísticas de Char
OnPCLoginEvent:
	set logou,logou + 1;
	end;
} 

 

 

 

 
I need to study more
 
I need to study more
 
Edited by Tsuuu

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.