patison234

Friend

Mar 25th, 2014
360
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.35 KB | None | 0 0
  1. # # # # # # # # # # # # # # # #
  2. # Script by PatisonPlayGames  #
  3. # Name: Friend               #
  4. # Version: Beta 1.0           #
  5. # Skript: 2.0.2/2.1           #
  6. # # # # # # # # # # # # # # # #
  7.  
  8.  
  9.  
  10. #=============================================#
  11. #  Licencja Friend by PatisonPlayGames!       #
  12. # + Nie zezwalam na:                          #
  13. # - Usuwanie tresci o autorze!                #
  14. # - Udostepnaniu skryptu innym!               #
  15. # - Podszywanie sie pod autora!               #
  16. # - Uzywanie kodu skryptu w swoich skryptach! #
  17. # - Zarabianie na skrypcie!                   #
  18. # + Zezwalam na:                              #
  19. # - Dodawanie kodu na swoja potrzebe!         #
  20. # - Modyfikowanie wiadomosci!                 #
  21. #=============================================#
  22.  
  23.  
  24. command /friend [<text>] [<text>] [<text>]:
  25.     aliases: f,
  26.     trigger:
  27.         if arg 1 is not set:
  28.             send "&eKomendy &cFriend:"
  29.             send "&e/friend pomoc - &7Wszystkie dostepne komendy."
  30.             send "&e/friend add (player) - &7Dodaje przyjaciela."
  31.             send "&e/friend remove (player) - &7Usuwa przyjaciela."
  32.             send "&e/friend accept (player) - &7Akceptuje zaproszenie do przyjaciol."
  33.             send "&e/friend deny (player) - &7Odrzuca zaproszenie do przyjaciol."
  34.             send "&e/friend list (strona) - &7Lista przyjaciol."
  35.             stop
  36.         if arg 1 is "pomoc":
  37.             send "&eKomendy &cFriend:"
  38.             send "&e/friend pomoc - &7Wszystkie dostepne komendy."
  39.             send "&e/friend add (player) - &7Dodaje przyjaciela."
  40.             send "&e/friend remove (player) - &7Usuwa przyjaciela."
  41.             send "&e/friend accept (player) - &7Akceptuje zaproszenie do przyjaciol."
  42.             send "&e/friend deny (player) - &7Odrzuca zaproszenie do przyjaciol."
  43.             send "&e/friend list (strona) - &7Lista przyjaciol."
  44.             stop   
  45.         if arg 1 is "add" or "dodaj":
  46.             if arg 2 is set:
  47.                 if player has permission "friend.add" or "friend.admin" or "friend.player":
  48.                     if arg 2 parsed as player is online:
  49.                         if {friend.%player%.%argument 2%} is not set:
  50.                             set {friend.%player%.%argument 2%} to false
  51.                         if {friend.%player%.%argument 2%} is false:
  52.                             set {invite.%player%.%argument 2%} to true
  53.                             send "&7- - - - - - - - - - - - - - - - - - - - - - - - - - - - -" to argument 2 parsed as player  
  54.                             send "&e Gracz &a%player% &e wyslal ci zaproszenie do przyjaciol." to argument 2 parsed as player  
  55.                             send "&e  Wpisz &a/f accept %player% &E lub &a/f deny %player%" to argument 2 parsed as player 
  56.                             send "&7- - - - - - - - - - - - - - - - - - - - - - - - - - - - -" to argument 2 parsed as player  
  57.                             send "&7- - - - - - - - - - - - - - - - - - - - - - - "
  58.                             send "&e Zaproszenie zostalo wyslane do &a%argument 2%"
  59.                             send "&7- - - - - - - - - - - - - - - - - - - - - - - "
  60.                             wait 2 minutes
  61.                             if {friend.%player%.%argument 2%} is false:
  62.                                 set {invite.%player%.%argument 2%} to false
  63.                                 send "&7- - - - - - - - - - - - - - - - - - - - - - - " to arg 2 parsed as player
  64.                                 send "&e    Czas oczekiwania na akceptacje minal" to arg 2 parsed as player
  65.                                 send "&7- - - - - - - - - - - - - - - - - - - - - - - " to arg 2 parsed as player
  66.                                 send "&7- - - - - - - - - - - - - - - - - - - - - - - "
  67.                                 send "&e    Czas oczekiwania na akceptacje minal"
  68.                                 send "&7- - - - - - - - - - - - - - - - - - - - - - - "
  69.                                 stop
  70.                         send "&7[&cFriend&7] &eTo jest juz twoj przyjaciel!"
  71.                         stop
  72.                     set {invite.%player%.%argument 2%} to true
  73.                     set {offline.%argument 2%} to true
  74.                     set {inviter.%argument 2%} to the player
  75.                     send "&7- - - - - - - - - - - - - - - - - - - - - - - "
  76.                     send "&e Zaproszenie zostalo wyslane do &a%argument 2%"
  77.                     send "&7- - - - - - - - - - - - - - - - - - - - - - - "
  78.                     stop               
  79.                 send "&7[&cFriend&7] Nie masz uprawnien do tej komendy!"
  80.                 stop
  81.             send "&7[&cFriend&7] &ePodaj nick gracza!"
  82.             stop
  83.         if arg 1 is "accept" or "akceptuj":
  84.             if arg 2 is set:
  85.                 if player has permission "friend.accept" or "friend.admin" or "friend.player":
  86.                     if {invite.%argument 2%.%player%} is true:
  87.                         set {friend.%argument 2%.%player%} to true
  88.                         set {invite.%argument 2%.%player%} to false
  89.                         add player to {friend.%argument 2%::*}
  90.                         add argument 2 to {friend.%player%::*}
  91.                         set {offline.%player%} to false
  92.                         send "&7- - - - - - - - - - - - - - - - - - - - - - - " to arg 2 parsed as player
  93.                         send "&e &a%player% &ejest teraz twoim przyjacielem" to arg 2 parsed as player
  94.                         send "&7- - - - - - - - - - - - - - - - - - - - - - - " to arg 2 parsed as player
  95.                         send "&7- - - - - - - - - - - - - - - - - - - - - - - "
  96.                         send "&a%argument 2% &ejest teraz twoim przyjacielem."
  97.                         send "&7- - - - - - - - - - - - - - - - - - - - - - - "
  98.                         stop
  99.                     send "&7[&cFriend&7] &eBrak zaproszenia!"
  100.                     stop
  101.                 send "&7[&cFriend&7] Nie masz uprawnien do tej komendy!"
  102.                 stop
  103.             send "&7[&cFriend&7] &ePodaj nick gracza!"
  104.             stop
  105.         if arg 1 is "deny" or "odrzuc":
  106.             if arg 2 is set:
  107.                 if player has permission "friend.deny" or "friend.admin" or "friend.player":
  108.                     if {invite.%argument 2%.%player%} is true:
  109.                         set {invite.%argument 2%.%player%} to false
  110.                         set {offline.%player%} to false
  111.                         send "&7- - - - - - - - - - - - - - - - - - - - - - - " to arg 2 parsed as player
  112.                         send "&e &a%player% &eodrzucil twoje zaproszenie" to arg 2 parsed as player
  113.                         send "&7- - - - - - - - - - - - - - - - - - - - - - - " to arg 2 parsed as player
  114.                         send "&7- - - - - - - - - - - - - - - - - - - - - - - "
  115.                         send "&a &eOdrzuciles zaprosze od &a%argument 2%"
  116.                         send "&7- - - - - - - - - - - - - - - - - - - - - - - "
  117.                         stop
  118.                     send "&7[&cFriend&7] &eBrak zaproszenia!"
  119.                     stop
  120.                 send "&7[&cFriend&7] Nie masz uprawnien do tej komendy!"
  121.                 stop
  122.             send "&7[&cFriend&7] &ePodaj nick gracza!"
  123.             stop
  124.         if arg 1 is "remove" or "usun":
  125.             if arg 2 parsed as offline player is set:
  126.                 if player has permission "friend.remove" or "friend.admin" or "friend.player":                           
  127.                     if {friend.%player%.%argument 2%} is true:
  128.                         set {friend.%player%.%argument 2%} to false
  129.                         remove offline player from {friend.%argument 2%::*}
  130.                         remove argument 2 parsed as offline player from {friend.%player%::*}
  131.                         send "&7- - - - - - - - - - - - - - - - - - - - - - - " to arg 2 parsed as player
  132.                         send "&e &a%player% &enie jest juz twoim przyjacielem" to arg 2 parsed as player
  133.                         send "&7- - - - - - - - - - - - - - - - - - - - - - - " to arg 2 parsed as player
  134.                         send "&7- - - - - - - - - - - - - - - - - - - - - - - "
  135.                         send "&a%argument 2% &enie jest juz twoim przyjacielem."
  136.                         send "&7- - - - - - - - - - - - - - - - - - - - - - - "
  137.                         stop
  138.                     if {friend.%argument 2%.%player%} is true:
  139.                         set {friend.%argument 2%.%player%} to false
  140.                         send "&7- - - - - - - - - - - - - - - - - - - - - - - " to arg 2 parsed as player
  141.                         send "&e &a%player% &enie jest juz twoim przyjacielem" to arg 2 parsed as player
  142.                         send "&7- - - - - - - - - - - - - - - - - - - - - - - " to arg 2 parsed as player
  143.                         send "&7- - - - - - - - - - - - - - - - - - - - - - - "
  144.                         send "&a%argument 2% &enie jest juz twoim przyjacielem."
  145.                         send "&7- - - - - - - - - - - - - - - - - - - - - - - "
  146.                         remove offline player from {friend.%argument 2%::*}
  147.                         remove argument 2 parsed as offline player from {friend.%player%::*}
  148.                         stop
  149.                     send "&7[&cFriend&7] &eNie masz takiego przyjaciela."
  150.                     stop
  151.                 send "&7[&cFriend&7] Nie masz uprawnien do tej komendy!"
  152.                 stop
  153.             send "&7[&cFriend&7] &ePodaj nick gracza!"
  154.             stop
  155.         if arg 1 is "chat":
  156.             if arg 2 is set:
  157.                 if size of {friend.%player%::*} is greater than 0:
  158.                     send "&2Friend > &7%player%: &f%coloured argument 2%" to {friend.%player%::*}
  159.                     send "&2Friend > &7%player%: &f%coloured argument 2%" to the player
  160.                     stop
  161.                 send "&7[&cFriend&7] &eNie masz zadnych przyjaciol!"
  162.                 stop
  163.             send "&7[&cFriend&7] &ePodaj wiadomosc!"
  164.             stop
  165.         if arg 1 is "lista" or "list":
  166.             set {_strona} to arg 2 parsed as number
  167.             if {_strona} is not set:
  168.                 set {_strona} to 1
  169.             set {_liczbafriend} to size of {friend.%player%::*}
  170.             set {_liczba-stron} to ceil({_liczbafriend}/10)
  171.             if {_liczba-stron} is smaller than 1:
  172.                 set {_liczba-stron} to 1
  173.             if {_strona} is smaller than 1:
  174.                 send "&7[&cFriend&7] &eNie ma takiej strony!"
  175.                 stop
  176.             if {_strona} is greater than {_liczba-stron}:
  177.                 send "&7[&cFriend&7] &eNie ma takiej strony!"
  178.                 stop
  179.             if size of {friend.%player%::*} is smaller than 1:
  180.                 send "&7[&cFriend&7] &eNie masz zadnych przyjaciol!"
  181.                 stop
  182.             clear {_friend.%player%::*}
  183.             loop {friend.%player%::*}:
  184.                 add loop-value to {_friend.%player%::*}
  185.             send "&eLista przyjaciol &eStrona: &a%{_strona}%&e/&a%{_liczba-stron}%"
  186.             loop {_liczbafriend} times:
  187.                 set {_lista} to ({_strona}-1)*10
  188.                 add loop-number to {_lista}
  189.                 if {_friend.%player%::%{_lista}%} is not set:
  190.                     stop
  191.                 if loop-number is 11:
  192.                     stop
  193.                 if {_friend.%player%::%{_lista}%} is online:
  194.                     send "&6%{_lista}%. &7%{_friend.%player%::%{_lista}%}% &aAktualnie Online!"
  195.                 if {_friend.%player%::%{_lista}%} is offline:
  196.                     send "&6%{_lista}%. &7%{_friend.%player%::%{_lista}%}% &cAktualnie Offline!"   
  197.         if arg 1 is "reload" or "przeladuj":
  198.             if player has permission "friend.reload" or "friend.admin":
  199.                 execute console command "/sk reload %script%"
  200.                 send "&7[&cFriend&7] &ePrzeladowano!"
  201.                 stop
  202.             send "&7[&cFriend&7] Nie masz uprawnien do tej komendy!"
  203.             stop                       
  204.  
  205.                                              
  206. on join:
  207.     if {offline.%player%} is true:
  208.         wait 2 seconds
  209.         send "&7- - - - - - - - - - - - - - - - - - - - - - - - - - - - -"
  210.         send "&e Gracz &a%{inviter.%player%}% &e wyslal ci zaproszenie do przyjaciol."
  211.         send "&e  Wpisz &a/f accept %{inviter.%player%}% &E lub &a/f deny %{inviter.%player%}%"
  212.         send "&7- - - - - - - - - - - - - - - - - - - - - - - - - - - - -"  
  213.         wait 2 minutes
  214.         if {friend.%{inviter.%player%}%.%player%} is false:
  215.             set {invite.%{inviter.%player%}%.%player%} to false
  216.             send "&7- - - - - - - - - - - - - - - - - - - - - - - " to {inviter.%player%}
  217.             send "&e    Czas oczekiwania na akceptacje minal" to {inviter.%player%}
  218.             send "&7- - - - - - - - - - - - - - - - - - - - - - - " to {inviter.%player%}
  219.             send "&7- - - - - - - - - - - - - - - - - - - - - - - "
  220.             send "&e    Czas oczekiwania na akceptacje minal"
  221.             send "&7- - - - - - - - - - - - - - - - - - - - - - - "
  222.             stop
Advertisement
Add Comment
Please, Sign In to add comment