Jump to content
  • 0

I am creating vip npc


Babyton

Question


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  5
  • Reputation:   0
  • Joined:  02/19/13
  • Last Seen:  

Good evening everyone, I was one time without messing with ragnarok and now decided to go back, so I'm creating a vip npc using "% d /% m /% Y" all right so far, the first time the npc adds the level of vip which is 1,2 or 3 days and everything right, but if I go back to the npc and try to add more days he does not add, and for example if I add 10 days he sometimes adds but adds only eight days, as I said I was about two years without messing with scripts and now I'm back so I do not remember much more, posted the npc below, if anyone can help me explaining / pointing out the mistake I am grateful now.

 

Sorry for pessimo English, I am Brazilian and I use the rathena.

 

 

NOTE: The npc is not all ready.

 

 

prontera,159,185,4 script ADM VIP 50,{
 
 
if(!getgmlevel())
{
mes "^Olá, você não é VIP.";
mes "Caso esteja interessado visite nosso site ^FF0000"+$site$+"^000000.";
close;
}
while(1){
mes set ( @AVIP$, "[ ^00008BADM VIP^000000 ]" );
query_sql "SELECT COUNT(1) FROM `login` WHERE `sex` != 'S' AND `level` <= '3'", @Total;
query_sql "SELECT COUNT(1) FROM `login` WHERE `sex` != 'S' AND `level` = '1'", @Total1;
query_sql "SELECT COUNT(1) FROM `login` WHERE `sex` != 'S' AND `level` = '2'", @Total2;
query_sql "SELECT COUNT(1) FROM `login` WHERE `sex` != 'S' AND `level` = '3'", @Total3;
mes $@BTDN$+" "+strcharinfo(0);
mes "Temos ^FF0000"+ @Total +"^000000 Contas VIP no servidor sendo:";
mes @Total1+" VIP'S BRONZE";
mes @Total2+" VIP'S PRATA";
mes @Total3+" VIP'S GOLD"; 
if (select("^FF0000»^000000 Listar VIP's:^FF0000»^000000 Adicionar/Remover VIP")==1)
{
next;
query_sql "SELECT userid,DATE_FORMAT(`dt_vip`, '%d/%m/%Y') FROM login WHERE level=1",@gtd$,@dtvc$;
for(set @i, 0; @i < getarraysize(@gtd$); set @i, @i + 1){
mes @AVIP$;
mes "Contas VIP:";
mes "Login: ^FF0000"+@gtd$[@i]+"^000000";
mes "Validdade do VIP: ^FF0000"+@dtvc$[@i]+"^000000";
next;
}
 
continue;
}
next;
while(1){
mes @AVIP$;
mes "Insira o Login da conta.";
input @login$;
 
next;
 
query_sql "select account_id from login where userid='"+@login$+"'",@aid;
if( ! @aid )
mes @AVIP$;
mes "Conta não localizada.";
next; continue;
}
if ( @aid == getcharid(3) )
{
mes @AVIP$;
mes "Não permitido";
next; continue;
}
set @dataVencimento$,0; set @aid2,0;
query_sql "SELECT DATE_FORMAT(`dt_vip`, '%d/%m/%Y') FROM `login` WHERE `account_id` = "+@aid,@dataVencimento$;
query_sql "SELECT (`dt_vip` IS NULL OR `dt_vip` < CURDATE()) FROM `login` WHERE `account_id` = "+@aid2, @semvip;
mes @AVIP$;
if ( @semvip ) mes "^0000CD"+@login$+"^000000 não tem vip ativo em sua conta"; else mes "^0000CD"+@login$+"^000000 tem vip ativo em sua conta até ^FF0000"+@dataVencimento$;
mes "Insira a quantia de dias.";
input @amount;
 
next;
 
mes @AVIP$;
deletearray @name$[0],getarraysize(@name$);
query_sql "select name from `char` where account_id="+@aid,@name$;
mes "Qual o tipo de VIP?";
 
set .@menu, select ( "^FF0000»^000000 Gold:^FF0000»^000000 Prêmio:^FF0000»^000000 Master" ); 
if ( .@menu == 1 ) set @VIPType,1;
if ( .@menu == 2 ) set @VIPType,2;
if ( .@menu == 3 ) set @VIPType,3;
 
next;
 
mes @AVIP$;
mes "^4682B4Account ID: ^EEAD2D"+@aid;
mes "^4682B4Dias à Adicionar: ^EEAD2D"+@amount;
mes "^4682B4Tipo de VIP à Adicionar: ^EEAD2D"+$@TypeVIP$[@VIPType];
mes "^4682B4VIP válido até: ^EEAD2D"+@dataVencimento$;
mes "^4682B4Chars Encontrados: ";
for(set @i,0;@i<getarraysize(@name$);set @i,@i+1) mes "^6A5ACD- "+@name$[@i];
if(select("^FF0000»^000000 Prosseguir:^FF0000»^000000 Cancelar") == 2) { next; continue;}  else { 
 
query_sql "UPDATE `login` SET `level` = "+@VIPType+", `dt_vip` = DATE_ADD(CURDATE(),INTERVAL "+@amount+" DAY) WHERE `level` = "+@lvl+" AND `account_id` = "+@aid;
 
next;
mes @AVIP$;
mes "^4682B4VIP adicionado com sucesso.";
atcommand "@reloadpcdb";
query_sql "SELECT DATE_FORMAT(`dt_vip`, '%d/%m/%Y') FROM `login` WHERE `account_id` = "+@aid,@dataVencimento$;
 
if(isloggedin(@aid)) message rid2name(@aid),"Foi adicionado à sua conta "+@amount+" dias VIP no plano "+$@TypeVIP$[@VIPType]+" e agora seu vip é válido até "+@dataVencimento$;
close;
}
}
}
}
 
 
 
- script conf_oninit -1,{
 
 
OnInit:
// ============================== NPC VIP ==============================
 
setarray $@TypeVIP$[0],"Não VIP","Gold","Prêmio","Master";
 
//========================================================================
set $site$,"www.server.com";
set $sv$,"server";
end;
 
}
 
 

 

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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