Advertisement
slp13at420

WD VIP upgrade certificate

Jan 2nd, 2013
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.48 KB | None | 0 0
  1. -- certificate that will give you VIP2 without voting
  2. -- by Black Wolf of Blackwolfsden.dyndns-free.com
  3. -- this item will modify votes count and vip level in db then delete itself
  4. -- from the inventory (when item is clicked on)
  5. -- with many thanks to rochet2 of ac-web.org for getting it all working
  6.  
  7.  
  8. function Item_Trigger(item, event, player)
  9.  
  10. local CheckVipl = WorldDBQuery("SELECT `vip` FROM logon.accounts WHERE `login` = '"..player:GetAccountName().."';");
  11.  
  12. local Vip = CheckVipl:GetColumn(0):GetLong()
  13.  
  14.     if (Vip < 10) then -- max vip level cant upgrade anymore. current max level is 10
  15.     WorldDBQuery("UPDATE logon.accounts SET `votes` = `votes` + '125' WHERE `login` = '"..player:GetAccountName().."' LIMIT 1; ");
  16.     WorldDBQuery("UPDATE logon.accounts SET `vip` = `vip` + '1' WHERE `login` = '"..player:GetAccountName().."' LIMIT 1; ");
  17.     player:SendBroadcastMessage("Congratz. you are now VIP"..Vip + '1'..".")
  18.     player:RemoveItem(62000, 1)
  19.     else
  20.     if (Vip == 10) then -- max VIP level is 10 . this will return the char the cost of the certificate and delete the cert if char vip is 10
  21.     player:SendBroadcastMessage("you are VIP"..Vip..".you cannot level up anymore.")
  22.     player:SendBroadcastMessage("A Refund Is In Progress....DONT BUY ANOTHER ONE....Dumbazz")
  23.     WorldDBQuery("UPDATE logon.accounts SET `mg` = `mg` + '50000' WHERE `login` = '"..player:GetAccountName().."' LIMIT 1; ");
  24.     player:RemoveItem(62000, 1)
  25.     else
  26. end
  27. end
  28. end
  29. RegisterItemGossipEvent(62000, 1, "Item_Trigger")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement