Advertisement
Guest User

Untitled

a guest
May 18th, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. variables:
  2. {_variable} = 0
  3.  
  4. script options:
  5. $ init com.mysql.jdbc.Driver
  6. $ db url jdbc:mysql://0.0.0.0:3306/buildbattle
  7. $ db username root
  8. $ db password xxxxxxx
  9.  
  10. command /punti add <player> <number>:
  11. trigger:
  12. update "INSERT INTO punteggi (playername, punti) SELECT * FROM (SELECT '%arg-1%', '1') AS tmp WHERE NOT EXISTS ( SELECT playername FROM punteggi WHERE playername = '%arg-1%' ) LIMIT 1;"
  13. set {punti} to the first element out of objects in column "punti" from result of query "SELECT `punti` FROM `punteggi` WHERE playername = '%arg-1%'" and close
  14. update "UPDATE punteggi SET punti = '%{punti}%' + %arg-2% WHERE playername = '%arg-1%';"
  15.  
  16. options:
  17. Sound1: NOTE_PLING
  18. SoundVolume: 100.0
  19.  
  20. command /punteggio <player=%player%>:
  21. trigger:
  22. set {_player} to arg-player
  23. set {_variable} to the first element out of objects in column "punti" from result of query "SELECT punti FROM punteggi WHERE playername='%{_player}%'"
  24. set action bar of player to "&2Hai %{_variable}% punti!"
  25. play "{@Sound1}" to player at volume {@SoundVolume}
  26. send player title "%{_player}%" with subtitle "Punteggio: &2%{_variable}%" for 4 seconds
  27. wait 5 seconds
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement