Jump to content
  • 0

SQL Function


Saruman

Question


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   3
  • Joined:  02/01/14
  • Last Seen:  

I've made this function in order to have a 24h VIP Ticket(I've put 40 seconds to test), but it's not working. Can someone see what's wrong ?

 


function script vip1 {
 
set $nivelVip, 1;
 
query_sql "UPDATE `login` SET `group_id` = "+$nivelVip+" WHERE `group_id` = 0 AND `account_id` = "+getcharid(3);
 
dispbottom "Conta VIP inserida com sucesso! Relogue seu personagem para ativá-la.";
addtimer 40000, "vip1::OnTempo2";
end;
    
OnTempo2:
dispbottom "Período VIP terminado."; 
query_sql "UPDATE `login` SET `group_id` = 0 WHERE `group_id` = 1 AND `account_id` = "+getcharid(3);
    end;
 
} 

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

change your script from "FUNCTION" become a "NPC"

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   3
  • Joined:  02/01/14
  • Last Seen:  

change your script from "FUNCTION" become a "NPC"

 

But it's a function for this item:

 

20682,Ticket_Vip,Ticket VIP #1,0,10000,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "vip1"; },{},{}
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

you can use doevent , the addtimer need you to attach the script to an event label that appeared in a NPC, not FUNCTION.

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