Jump to content
  • 0

[VIP SYSTEM] Troubles


Lullaby

Question


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   2
  • Joined:  04/06/20
  • Last Seen:  

EN:
Hi, guys!
I've been trying to fix this sql function at my personal server, but wasn't successfully.

The problem is: the VIP SYSTEM change account group id to 1 when I use the VIP Item, and date this account normally.
But after a few minutes after using this VIP Item the account group id return to 0, and the system still reading this account like a VIP account...
So... I use this item, change group id temporarily to 1, still dated account with "VIP", and return to group id 0 a few minutes later...

Can anyone help me with this trouble?

PTBR:
Oi, pessoal!
Eu estive há um bom tempo tentando entender e consertar esse sistema SQL, que apresenta defeitos em meu servidor. Entretanto, eu não entendo muito bem ainda de SQL...
O problema é que, quando eu uso o Cartão VIP para adicionar VIP na minha conta, ele funciona normalmente...
Só que após alguns minutos, o group_id da conta volta a ser 0, e eu não entendo o porquê.
A data da conta VIP continua setada normalmente; quando eu entro na conta, mostra o dia do vencimento do vip e tudo mais, só que o group_id volta a ser 0 do nada...
Quando eu uso o Cartão, ele muda a conta para VIP, mas depois de alguns minutos, torna a ser group_id 0...

Alguém poderia me ajudar com esse problema?

This is my function addvip:
Essa é minha function addvip:

Spoiler

/*ALTER TABLE `login` ADD `dt_vip` INT(4) NOT NULL DEFAULT '0';*/

function    script    addvip7    {

set $nivelVip, 1;
set $diasVip, 7;
set $verificaVip, 1;

    if (getgroupid() == 1) goto vipplayer;
    
    query_sql "UPDATE `login` SET `group_id` = "+$nivelVip+", `dt_vip` = DATE_ADD(CURDATE(),INTERVAL "+$diasVip+" DAY) WHERE `group_id` = 0 AND `account_id` = "+getcharid(3);

    dispbottom "[SISTEMA VIP]: Você inseriu +7d de VIP.",0xF58F40;
    sleep2 5000;
    dispbottom "[SISTEMA VIP]: Reconecte-se para atualizar sua conta.",0xF58F40;
    end;

vipplayer:

    getitem 29256,1;
    dispbottom "[SISTEMA VIP]: Você já é um jogador VIP.",0xF58F40;
    sleep2 5000;
    dispbottom "[SISTEMA VIP]: Por favor, tente novamente quando seus dias VIP expirarem.",0xF58F40;
    end;

}

function    script    addvip15    {

set $nivelVip, 1;
set $diasVip, 15;
set $verificaVip, 1;

    if (getgroupid() == 1) goto vipplayer;

    query_sql "UPDATE `login` SET `group_id` = "+$nivelVip+", `dt_vip` = DATE_ADD(CURDATE(),INTERVAL "+$diasVip+" DAY) WHERE `group_id` = 0 AND `account_id` = "+getcharid(3);

    dispbottom "[SISTEMA VIP]: Você inseriu +15d de VIP.",0xF58F40;
    sleep2 5000;
    dispbottom "[SISTEMA VIP]: Reconecte-se para atualizar sua conta.",0xF58F40;
    end;

vipplayer:

    getitem 29257,1;
    dispbottom "[SISTEMA VIP]: Você já é um jogador VIP.",0xF58F40;
    sleep2 5000;
    dispbottom "[SISTEMA VIP]: Por favor, tente novamente quando seus dias VIP expirarem.",0xF58F40;
    end;

}

function    script    addvip30    {

set $nivelVip, 1;
set $diasVip, 30;
set $verificaVip, 1;

    if (getgroupid() == 1) goto vipplayer;

    query_sql "UPDATE `login` SET `group_id` = "+$nivelVip+", `dt_vip` = DATE_ADD(CURDATE(),INTERVAL "+$diasVip+" DAY) WHERE `group_id` = 0 AND `account_id` = "+getcharid(3);

    dispbottom "[SISTEMA VIP]: Você inseriu +30d de VIP.",0xF58F40;
    sleep2 5000;
    dispbottom "[SISTEMA VIP]: Reconecte-se para atualizar sua conta.",0xF58F40;
    end;

vipplayer:

    getitem 29258,1;
    dispbottom "[SISTEMA VIP]: Você já é um jogador VIP.",0xF58F40;
    sleep2 5000;
    dispbottom "[SISTEMA VIP]: Por favor, tente novamente quando seus dias VIP expirarem.",0xF58F40;
    end;

}

-    script    GerenciadorVip    -1,{

        OnPCLoginEvent:    

        query_sql "UPDATE `login` SET `group_id`= 0 WHERE `group_id` = "+$nivelVip+" AND (`dt_vip` IS NULL OR `dt_vip` < CURDATE())";
        query_sql "SELECT (`dt_vip` IS NULL OR `dt_vip` < CURDATE()) FROM `login` WHERE `account_id` = "+getcharid(3), @verificaVip;

        if (@verificaVip) {

        dispbottom "Torne-se VIP e desfrute de nossos serviços especiais.",0xF58F40;
        dispbottom "Para consultar nossos preços, abra a Loja de Cash.",0xF58F40;
        end;

}

    query_sql "SELECT DATE_FORMAT(`dt_vip`, '%d/%m/%Y') FROM `login` WHERE `account_id` = "+getcharid(3), @dataVencimento$;

    dispbottom "[SISTEMA VIP]: Sua conta expira em: "+@dataVencimento$+"",0xF58F40;
    end;

}

Sorry for bad english!

 

Example:

image.png.9a87026d0fe79cae84c0c5b9eb342269.png
This is the System saying that my account expires at 19/06/2020.
So when I use any vip command, the system says I'm not VIP.
(But I'm really VIP temporarily when I use this VIP Item)

-- EDIT --
How can I change date vip to hours?

Edited by tecapeteca
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

Why are you doing that?
 

---------------------------------------

*vip_status(<type>,{"<character name>"})

Returns various information about a player's VIP status.

Valid types:
 VIP_STATUS_ACTIVE - VIP status: true if the player is a VIP or false if not
 VIP_STATUS_EXPIRE - VIP expire timestamp if the player is VIP or 0 if not
 VIP_STATUS_REMAINING - VIP time remaining in seconds

NOTE: This command is only available if the VIP System is enabled.

---------------------------------------

*vip_time <time>,{"<character name>"};

Changes a player's VIP time (in minutes). A positive value will increase time, and a
negative value will decrease time.

NOTE: This command is only available if the VIP System is enabled.

---------------------------------------

Use these script commands.

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