Jump to content
  • 0

@ govip modified.


Scofield

Question


  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.03
  • Content Count:  265
  • Reputation:   11
  • Joined:  01/11/13
  • Last Seen:  

I ultilizo a system that does not let the vip lv nv one account in the database, it works differently.

if I wanted to use the command @ govip put in src it does lv checking the database, wanted to know how I change the src to be compatible with my system vip.

 

 

 

I use System vip


 
prontera,158,201,4    script    Porteiro VIP#h2-2::vip    402,{

//Configurações suas:
//
// Level da conta VIP:
//set $levelvip, 1;
//
// Sala VIP:
set @mapa$,"sec_in01";
set @cordx,85;
set @cordy,167;
//
//Nome do npc:
set .namenpc$, "^CD0000[Porteiro VIP]^000000";
//
//Seu site aqui:
set @site$,"www.imperialro.com.br";
//
//Dias VIP:
set $numdia, 86400;
set $numdias, 432000;
set $numdias2, 2592000;    
//
//Preços do VIP:
set $iten, 1;
set $item, 1;
set $item2, 1;        
//============================================================

if( isPremium() == 1 ) {

mes .namenpc$;
mes "Olá "+strcharinfo(0)+"!";
mes "O que deseja?";

        switch(select(    "- Sala VIP",
                        "- Dias restantes de VIP.",
                        "- Nada não...")){
                
next;
            
    case 1:
            mes .namenpc$;
            mes "Quer entrar na sala vip?";
            menu "Sim",yes10,"Não",not10;
            
            yes10:
                next;
                mes .namenpc$;
                warp "sec_in01",85,167;
            close;

            not10:
                next;
                mes .namenpc$;
                mes "OK, até logo.";
            close;
    case 2:
            mes .namenpc$;
            mes "Você ainda tem " + callfunc("Time2Str_VIP",#Premium_Tick) + " como VIP.";
            mes "Após o termino de seu VIP, recarregue! E ajude o servidor a se manter!";
            close;

    case 3:
            mes .namenpc$;
            mes "OK, até logo.";
            close;

}
}
    mes .namenpc$;
    mes "Para obter VIP você tem que ter Ticket VIP.";
    mes "Visite ^CD0000"+@site$+"^000000 para obter Ticket VIP!";
    mes "Você não é VIP, deseja obter VIP?";

            if(select("Sim!:Não.") == 1){
                next;
                mes .namenpc$;
                mes "Temos três formas de pagamentos,";
                mes "^FF0000"+$iten+" Ticket = 1 dia.^000000";
                mes "^FF0000"+$item+" Ticket = 5 dias.^000000";
                mes "^FF0000"+$item2+" Ticket = 30 dias.^000000";
                next;

switch(select(    ""+$iten+" Ticket = 1 dia.",""+$item+" Ticket = 5 dias.",""+$item2+" Ticket = 30 dias." )){


    case 1:
            if(countitem(32011) < 1) goto SemItem;
            mes .namenpc$;
            if( isPremium() == 1 )
                mes "Você realmente deseja expandir durabilidade de sua conta VIP?";
            else
                mes "Você realmente deseja converter sua conta em VIP?";
            next;
            menu "Sim",-,"Não",not3;
            delitem 32011,1;
            if( isPremium() == 1 )
                set #Premium_Tick, #Premium_Tick +$numdia;
            else
                set #Premium_Tick, gettimetick(2)+$numdia;
            next;
            mes .namenpc$;
            mes "Dias VIP adicionados!";
            close;
                not3:
                next;
                mes .namenpc$;
                mes "OK, até logo.";
                close;

    case 2:
            if(countitem(32038) < 1) goto SemItem;
            mes .namenpc$;
            if( isPremium() == 1 )
                mes "Você realmente deseja expandir durabilidade de sua conta VIP?";
            else
                mes "Você realmente deseja converter sua conta em VIP?";
            next;
            menu "Sim",-,"Não",not4;
            delitem 32038,1;
            next;
            mes .namenpc$;
            mes "Dias VIP adicionados!";
            if( isPremium() == 1 )
                set #Premium_Tick, #Premium_Tick +$numdias;
            else
                set #Premium_Tick, gettimetick(2)+$numdias;
            close;
            not4:
                next;
                mes .namenpc$;
                mes "OK, até logo.";
                close;

    case 3:
                if(countitem(32002) < 1) goto SemItem;
                mes .namenpc$;
                if( isPremium() == 1 )
                    mes "Você realmente deseja expandir durabilidade de sua conta VIP?";
                else
                    mes "Você realmente deseja converter sua conta em VIP?";
                next;
                menu "Sim",-,"Não",not5;
                delitem 32002,1;                
                if( isPremium() == 1 )
                    set #Premium_Tick, #Premium_Tick +$numdias2;
                else
                    set #Premium_Tick, gettimetick(2)+$numdias2;
                next;
                mes .namenpc$;
                mes "Dias VIP adicionados!";
                close;
            not5:
                next;
                mes .namenpc$;
                mes "OK, até logo.";
                close;


        }
    }else{

next;
    mes .namenpc$;
    mes "OK, até logo.";
    close;

SemItem:
next;
mes "^CD0000[Porteiro VIP]^000000";
mes "Desculpe, mas você não tem Ticket VIP.";
mes "Visite ^CD0000"+@site$+"^000000 para obter Ticket VIP!";
close;

                    }
                    
}


-    script    CASH#L-1    -1,{
OnPCLoginEvent:
    if(#CASHPOINTS > 0)
    dispbottom "Você tem "+#CASHPOINTS+" Cash.";

}

// *********************************************************************
function    script    Time2Str_VIP    {

    set .@Time_Left, getarg(0) - gettimetick(2);
    
    set .@Days, .@Time_Left / 86400;
    set .@Time_Left, .@Time_Left - (.@Days * 86400);
    set .@Hours, .@Time_Left / 3600;
    set .@Time_Left, .@Time_Left - (.@Hours * 3600);
    set .@Minutes, .@Time_Left / 60;
    set .@Time_Left, .@Time_Left - (.@Minutes * 60);
    
    set .@Time$, "";
    if( .@Days >= 0 )
        set .@Time$, .@Time$ + .@Days + " dias, ";
    //else if( .@Days > 0 || .@Days == 0 )
    //    set .@Time$, .@Time$ + .@Days + " dia, ";


    if( .@Hours > 1 )
        set .@Time$, .@Time$ + .@Hours + ":";
    else if( .@Hours > 0 )
        set .@Time$, .@Time$ + .@Hours + ":";

    if( .@Minutes > 1 )
        set .@Time$, .@Time$ + .@Minutes + ":";
    else if( .@Minutes > 0 )
        set .@Time$, .@Time$ + .@Minutes + ":";

    if( .@Time_Left > 1 || .@Time_Left == 0 )
        set .@Time$, .@Time$ + .@Time_Left + "";
    else if( .@Time_Left == 1 )
        set .@Time$, .@Time$ + .@Time_Left + "";
    
    return .@Time$;
}
-    script    VIP#L-1    -1,{
OnPCLoginEvent:
    if (isPremium() == 0) end;
    dispbottom "Você ainda tem " + callfunc("Time2Str_VIP",#Premium_Tick) + " como VIP.";
    dispbottom "Após o termino de seu VIP, recarregue! E ajude o servidor a se manter!";
    end;
}

 

 

 

Modification of my src @ govip   src/map/atcommand.c

 

I do like the change here to make the check according to my system vip?

/*==========================================
 * @govip
 * => Teleporta o personagem para a Sala VIP [Heaven]
 *------------------------------------------*/
int atcommand_govip(const int fd, struct map_session_data* sd, const char* command, const char* message)
{
    nullpo_retr(-1,sd);
    if(sd->gmlevel < 1){
        clif_displaymessage(fd,"Somente VIPs podem acessar esta sala.");
        return -1;
    }
    pc_setpos(sd, mapindex_name2id("sec_in01"), 85, 167, 3);
    return 0;

}
Edited by cumbe11
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  318
  • Reputation:   54
  • Joined:  12/23/12
  • Last Seen:  

There is one other way we can set up commands other then source, that is using the bindatcmd script line.

Works just like an NPC Script, easy to edit and set up.

 

 

*bindatcmd "command","<NPC object name>::<event label>"{,<atcommand level>,<charcommand level>};

This command will bind a NPC event label to an atcommand. Upon execution of the
atcommand, the user will invoke the NPC event label. Each atcommand is only allowed
one binding. If you rebind, it will override the original binding.

The following variables are set upon execution:
	.@atcmd_command$       =  The name of the @command used.
	.@atcmd_parameters$[]  =  Array containing the given parameters, starting from an index of 0.
	.@atcmd_numparameters  =  The number of parameters defined.

Example:

When a user types the command "@test", an angel effect will be shown.

-	script	atcmd_example	-1,{
OnInit:
	bindatcmd "test",strnpcinfo(3)+"::OnAtcommand";
	end;
OnAtcommand:
	specialeffect2 338;
	end;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.03
  • Content Count:  265
  • Reputation:   11
  • Joined:  01/11/13
  • Last Seen:  

Thank you, I incontrei otherwise.

 

-    script    VIP#L-1    -1,{

OnPCLoginEvent:

    if (isPremium() == 0) end;

    dispbottom "Você ainda tem " + callfunc("Time2Str_VIP",#Premium_Tick) + " como VIP.";

    dispbottom "Após o termino de seu VIP, recarregue! E ajude o servidor a se manter!";

    end;

}

 

 

Replacing this

 

 

if(sd->gmlevel < 1){

 

by this

 

if(!pc_isPremium(sd)) {
Edited by cumbe11
Link to comment
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
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...