Jump to content

Question

Posted

I'm trying to add script option trading 3 points for 1 day vip, more is wrong giving someone help?

mes "Okay!";
set .@account_id,getcharid(3);
set .@usedPoints,3;
set $nivelVip, 1;
set $diasVip, 1;
set $verificaVip, 1;
query_sql("UPDATE `cp_v4p_voters` SET points=(points-"+.@usedPoints+") WHERE account_id='"+.@account_id+"'");
if (getgroupid() == 0){
query_sql "UPDATE `login` SET `group_id` = "+$nivelVip+", `dt_vip` = DATE_ADD(`dt_vip`,INTERVAL "+$diasVip+" DAY) WHERE `group_id` = "+$nivelVip+" AND `account_id` = "+getcharid(3);dispbottom "Relogue para ter seu VIP ativado.";
}else{
query_sql "UPDATE `login` SET `group_id` = "+$nivelVip+", `dt_vip` = DATE_ADD(`dt_vip`,INTERVAL "+$diasVip+" DAY) WHERE `group_id` = "+$nivelVip+" AND `account_id` = "+getcharid(3);
}
garbagecol();
close2;
message strcharinfo(0),"Points added";
end;

http://pastebin.com/yx19q9yx

6 answers to this question

Recommended Posts

Posted

Ho okay I misread your update function

need to replace -3 by 3

set .@account_id,getcharid(3);
updatePoints( .@account_id,3 );
// dispbottom "Relogue para ter seu VIP ativado.";
  • Upvote 1
Posted
mes "Pronto!";
set .@account_id,getcharid(3);
updatePoints( .@account_id,-3 );
// dispbottom "Relogue para ter seu VIP ativado.";
query_sql "UPDATE `login` SET `dt_vip` = if( `group_id` = 1 and `dt_vip` > now(), `dt_vip` + INTERVAL 1 day, now() + interval 1 day ), `group_id` = 1  WHERE `account_id` = "+ .@account_id;
atcommand "@adjgroup 1";
garbagecol();
close2;
message strcharinfo(0),"Pontos adicionados";
end;

?

Posted (edited)

Is that working like you expected ?

 

The problem is that is adds more 3 point instead of consuming

 

@edit

 

Example 3 points have changed by vip, but instead of zeroing the points are adding 3 more, infinitely

Edited by Break San

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...