Tony_PlySon

[Talkaction] Rep System

Apr 19th, 2013
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. function onSay(cid, words, param)
  2. t = string.explode(param, ",")
  3. pid = getPlayerByName(t[1])
  4. r = tonumber(t[2])
  5.  
  6. if not pid then
  7. doPlayerSendCancel(cid, "Player nao existente ou nao está online.")
  8. return true
  9. end
  10.  
  11. if not r then
  12. doPlayerSendCancel(cid, "Somente numeros para reputaçao.")
  13. return true
  14. end
  15.  
  16. if getPlayerStorageValue(cid, 12512) < os.time() then
  17. doPlayerSendCancel(cid, "Voce nao tem reps para adicionar.")
  18. return true
  19. end
  20.  
  21. if r > 2 then
  22. doPlayerSendCancel(cid, "O Maximo de rep que voce pode adicionar é 2")
  23. setPlayerStorageValue(cid, 12512, os.time() + 1000 * 60 * 60 * 24)
  24. return true
  25. end
  26.  
  27. setPlayerStorageValue(pid, 12513, r)
  28. doPlayerSendTextMessage(pid, 27, "Voce recebeu "..r.." reps do "..cid)
  29.  
  30. if t[1] == "check" then
  31. doPlayerSendTextMessage(cid, 27, "Voce tem "..getPlayerStorageValue(cid, 12513).." reps")
  32. return true
  33. end
  34. return true
  35. end
  36.  
  37. -- Comandos : /rep PlayerName, reps = /rep OrochiElf, 2
  38. -- Comando Check = /rep check
Advertisement
Add Comment
Please, Sign In to add comment