TFS 1.X Bounty Hunter System

Discussion in 'GlobalEvents, Spells & CreatureEvents' started by imkingran, Apr 14, 2014.

  1. Eldin

    Eldin Eldin Projects Premium User

    Joined:
    Jun 12, 2008
    Messages:
    1,259
    Likes Received:
    498
    Best Answers:
    0
    @imkingran

    Greets,
    Being so fast with the new talkaction was realy impressive, well done, I didn't want to post until I had a fair chance to try it fully.

    Im currently using TFS 1.1 and will be updating to 1.2 shortly when basicly everything is working correctly on the server in it's current state, almost done.

    Current Issues:

    1. Error when in logg when adding a new Bounty.
    I Believe it's only the broadcast part.
    Code (Text):
    1.  
    2.  
    3. Lua Script Error: [TalkAction Interface]
    4. data/talkactions/scripts/BountyHunterAdd.lua:onSay
    5. data/talkactions/scripts/BountyHunterAdd.lua:45: attempt to index global 'player
    6. ' (a nil value)
    7. stack traceback:
    8.   [C]: in function '__index'
    9.   data/talkactions/scripts/BountyHunterAdd.lua:45: in function <data/talka
    10. ctions/scripts/BountyHunterAdd.lua:1>
    11.  
    2. When killing someone with the Bounty added I get no reward.
    (Money is drawn from adding)

    3. The new talkaction window comes up but without any names.

    Was this mainly made for 1.2? Might be Worth to wait until I upgraded Before I put to much effort into fixing it?

    It's a great script in general, just have to figure this out. :)

    Kind Regards,
    Eldin.

    PS: Another cool idea is to make the entire Bounty add an NPC, I would definitely put the NPC in a dark bar!
     
  2. Codex NG

    Codex NG Coding Junkie

    Joined:
    Jul 24, 2015
    Messages:
    2,874
    Likes Received:
    1,388
    Best Answers:
    0
    Code (Text):
    1.  
    2. function onSay(cid, words, param) -- 1.0
    3.  
    4.  
    5. function onSay(player, words, param) -- 1.1+
    6.  
    7. make 1.0 compatible with 1.1+
    8. local player = Player(cid)
    Edit:
    That isn't the only thing that might need to be done to make 1.0 compatible with 1.1+
     
    Last edited: Feb 27, 2016
    imkingran and Eldin like this.
  3. Eldin

    Eldin Eldin Projects Premium User

    Joined:
    Jun 12, 2008
    Messages:
    1,259
    Likes Received:
    498
    Best Answers:
    0
    That was just stupid from my side, thank you Codex.

    I'll let my embarrasing text be if someone else have the same "problem". :oops:

    Kind Regards,
    Eldin.
     
    imkingran likes this.
  4. Guilherme sua

    Guilherme sua New Member

    Joined:
    Dec 19, 2015
    Messages:
    13
    Likes Received:
    1
    Best Answers:
    0
    So I'm having a similar problem , right works , until the time I kill the player , there comes the reward , and will not appear any more , would have to take a stand ?
     
  5. mrcrazy

    mrcrazy Premium User Premium User

    Joined:
    Sep 26, 2011
    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    I'm having a problem.
    If someone say the words but use the wrong player name, the function take the money and create a hunt in the website page.
    But the player even no exist. And in this case they can add infinite bounties with wrong player names.
    And the same occurs when someone say !hunt [prize], playername with space before playername.
    It takes the money and create a fake Bounty in website.
    Some fix for that?
     
    Last edited: Oct 4, 2016
  6. Oualid

    Oualid Active Member

    Joined:
    Aug 24, 2014
    Messages:
    307
    Likes Received:
    42
    Best Answers:
    0
    @imkingran what do I have to change to make it work with tfs 1.2? If im using this script it adds also names that don't exist and when a player gets killed the killer doesn't get anything and the killed one stays on the list
     
  7. Oualid

    Oualid Active Member

    Joined:
    Aug 24, 2014
    Messages:
    307
    Likes Received:
    42
    Best Answers:
    0
    Also if you're using it with TFS 1.2 you can add people that don't exist
     
  8. Oualid

    Oualid Active Member

    Joined:
    Aug 24, 2014
    Messages:
    307
    Likes Received:
    42
    Best Answers:
    0
  9. imkingran

    imkingran Learning everyday. Premium User

    Joined:
    Jan 15, 2014
    Messages:
    1,175
    Likes Received:
    353
    Best Answers:
    4
    @Oualid

    Hey man I just got back home from a long trip. I'll set up a TFS 1.2 environment tomorrow and update the main page. I may even re-do it since this thread was posted at a time where I was very nooby/new to the OT world, I'm still a noob but a little less, so I 'll try to make it a lot neater and add in more configurable options.

    If there's anything you'd like to see added that's not currently part of the original system let know! :)
     
    strutZ likes this.
  10. Oualid

    Oualid Active Member

    Joined:
    Aug 24, 2014
    Messages:
    307
    Likes Received:
    42
    Best Answers:
    0
    Thanks! As far as I know nothing has to be added :p
     
  11. imkingran

    imkingran Learning everyday. Premium User

    Joined:
    Jan 15, 2014
    Messages:
    1,175
    Likes Received:
    353
    Best Answers:
    4
    Hey I actually didn't test it on TFS 1.2 but I updated the script on the main page and fixed the issue I think you guys were having with the fake names. The database is different now so make sure you install the new table as well!

    Let me know if you get any problems while using it since I really wasn't able to test it very thoroughly but I didn't encounter any errors in my brief session on TFS 1.1! :S
     
    Oualid likes this.
  12. Oualid

    Oualid Active Member

    Joined:
    Aug 24, 2014
    Messages:
    307
    Likes Received:
    42
    Best Answers:
    0
    Awesome! Is the other problem also fixed? That when I kill the hunter im not getting any reward and that it shows that he's still alive? Im going to test it later today!
     
  13. Oualid

    Oualid Active Member

    Joined:
    Aug 24, 2014
    Messages:
    307
    Likes Received:
    42
    Best Answers:
    0
    Was just testing it now and both problems have been fixed but there is a new problem xd
    If you put a bounty on someone everything works except that there won't be any money removed from your balance but the bounty gets through so the money kinda gets cloned when you kill the guy yourself :p
     
  14. imkingran

    imkingran Learning everyday. Premium User

    Joined:
    Jan 15, 2014
    Messages:
    1,175
    Likes Received:
    353
    Best Answers:
    4
    Oops, nice find, you're the lab rat in this operation! :p

    Change:
    Code (Text):
    1.                     if player:getBankBalance() >= amount then
    2.                         return true
    3.                     end
    To:
    Code (Text):
    1.                     if player:getBankBalance() >= amount then
    2.                         return player:setBankBalance(player:getBankBalance() - amount)
    3.                     end
    I see some other errors with putting more points then you have as well. Going to fix that in a second!

    Here is the full changelog, you can either re-copy the library file or use quickdiff.com or WinMerge to compare and see what's changed.

     
    Last edited: Nov 2, 2016
    Oualid likes this.
  15. Oualid

    Oualid Active Member

    Joined:
    Aug 24, 2014
    Messages:
    307
    Likes Received:
    42
    Best Answers:
    0
    I've tested it and everything seems to work now! I did not test it with premium points tho since I haven't added premium points to my server yet. Also the other currency I will have to test to later today. But so far with gold everything seems to work perfectly! Thanks :)
     
  16. fishie

    fishie fishies-war

    Joined:
    Oct 27, 2016
    Messages:
    78
    Likes Received:
    1
    Best Answers:
    0
    Sorry for being a noob but where do i add the datebase part?
     
  17. Oualid

    Oualid Active Member

    Joined:
    Aug 24, 2014
    Messages:
    307
    Likes Received:
    42
    Best Answers:
    0
    in your database :p

    Go to phpmyadmin then click on your database then click on sql and put it there
     
  18. haiguri

    haiguri New Member

    Joined:
    Jun 25, 2012
    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    There is a lua script inside the database quotation that should NOT be there. It's a bit messy. I dont know where it should be either.
     
  19. Methemia

    Methemia New Member

    Joined:
    Feb 1, 2015
    Messages:
    20
    Likes Received:
    1
    Best Answers:
    0
  20. Tazd

    Tazd New Member

    Joined:
    Jan 13, 2017
    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0

Share This Page

Loading...