TFS 1.X Bounty Hunter System

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

  1. imkingran

    imkingran Learning everyday. Premium User

    Joined:
    Jan 15, 2014
    Messages:
    1,193
    Likes Received:
    360
    Best Answers:
    5
    Hello OtLand Community, today I will release the upgraded Bounty Hunter system for TFS 1.X

    Original System: http://otland.net/threads/bounty-hunters-system-player-hunt-system.27721/

    Thanks to @kamilwxx for helping me understand how to store db results back in 2014 when this thread was started.

    Customized for TFS 1.x, here we go:

    library [database query on top]:

    Code (Text):
    1.  
    2. --[[ db table
    3.     CREATE TABLE IF NOT EXISTS `bounty_hunter_system` (
    4.      `id` int(11) NOT NULL auto_increment,
    5.      `hunter_id` int(11) NOT NULL,
    6.      `target_id` int(11) NOT NULL,
    7.      `killer_id` int(11) NOT NULL,
    8.      `prize` bigint(20) NOT NULL,
    9.      `currencyType` varchar(32) NOT NULL,
    10.      `dateAdded` int(15) NOT NULL,
    11.      `killed` int(11) NOT NULL,
    12.      `dateKilled` int(15) NOT NULL,
    13.      PRIMARY KEY  (`id`)
    14.     ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
    15. ]]
    16.  
    17.  
    18. --------------------------------------
    19. ---------- START OF CONFIG -----------
    20. --------------------------------------
    21. local customCurrency = '' -- by default bank balance and premium points are included but you can add other stackable currencies like gold nuggets etc here eg, 'gold nugget' or you can use the itemID or the item name
    22. local config = {
    23.     ipCheck = true, -- players from same IP can not place bounty on each other
    24.     minLevelToAddBounty = 20, -- min lvl req to place a bounty
    25.     minLevelToBeTargeted = 20, -- min lvl req to be targeted by a bounty
    26.     broadcastKills = true, -- Should it broadcast a message to the whole game-world when someone was killed?
    27.     broadcastHunt = false, -- Should it broadcast a message to the whole game-world when someone is added to the bounty list?
    28.     mailbox_position = Position(32351,32223,6), -- If you are using a custom currency then we will send it to the players Mailbox, in order to do it you just need to put the location of one mailbox from your map here, doesn't matter which
    29.     currencies = {
    30.         ['gold'] = {        
    31.             minAmount = 1000000, -- Min amount of Gold allowed
    32.             maxAmount = 1000000000, -- Max amount of gold allowed
    33.             func =
    34.                 function(player, prize, currency)
    35.                     return player:setBankBalance(player:getBankBalance() + prize)
    36.                 end,
    37.             check =
    38.                 function(player, amount, currency)
    39.                     if player:getBankBalance() >= amount then
    40.                         return player:setBankBalance(player:getBankBalance() - amount)
    41.                     end
    42.                     return false
    43.                 end,
    44.         },
    45.         ['points'] = {
    46.             minAmount = 10, -- Min amount of premium points allowed
    47.             maxAmount = 500, -- Max amount of premium points allowed
    48.             func =
    49.                 function(player, prize, currency)
    50.                     return player:addPremiumPoints(prize)
    51.                 end,
    52.             check =
    53.                 function(player, prize, currency)
    54.                     if player:getPremiumPoints() > prize then
    55.                         return player:removePremiumPoints(prize)
    56.                     end
    57.                     return false
    58.                 end
    59.         },
    60.         [customCurrency] = {
    61.             minAmount = 10, -- Min amount of custom item allowed
    62.             maxAmount = 3000, -- Max amount of custom item allowed
    63.             func =
    64.                 function(player, prize, currency)
    65.                     return player:sendParcel(prize)
    66.                 end,
    67.             check =
    68.                 function(player, amount, currency)
    69.                     local itemID = ItemType(customCurrency):getId()
    70.                     if itemID > 0 and player:getItemCount(itemID) >= amount then
    71.                         player:removeItem(itemID, amount)
    72.                         return true
    73.                     end
    74.                     return false
    75.                 end,
    76.         }
    77.     }
    78. }
    79. --------------------------------------
    80. ----------- END OF CONFIG ------------
    81. --------------------------------------
    82. -- Only edit below if you know what you are doing --
    83.  
    84. local function trimString(str)
    85.   return (str:gsub("^%s*(.-)%s*$", "%1"))
    86. end
    87.  
    88. local function addItemsToBag(bpID, itemID, count)
    89.     local masterBag = Game.createItem(bpID,1)
    90.     local stackable = ItemType(itemID):isStackable()
    91.  
    92.     if stackable then
    93.         if count > 2000 then
    94.             local bp = Game.createItem(bpID,1)
    95.             masterBag:addItemEx(bp)
    96.             for i = 1, count do
    97.                 if bp:getEmptySlots() < 1 then
    98.                     bp = Game.createItem(bpID,1)
    99.                     masterBag:addItemEx(bp)
    100.                 end
    101.                 bp:addItem(itemID)
    102.             end
    103.         end
    104.         return masterBag
    105.     end
    106.  
    107.     if count > 20 then
    108.         local bp = Game.createItem(bpID,1)
    109.         masterBag:addItemEx(bp)
    110.         for i = 1, count do
    111.             if bp:getEmptySlots() < 1 then
    112.                 bp = Game.createItem(bpID,1)
    113.                 masterBag:addItemEx(bp)
    114.             end
    115.             bp:addItem(itemID)
    116.         end
    117.     return masterBag
    118.     end
    119.  
    120.     for i = 1, count do    
    121.         masterBag:addItem(itemID)
    122.     end
    123.     return masterBag
    124. end
    125.  
    126. function Player:sendParcel(amount)
    127.     local itemID = ItemType(customCurrency):getId()
    128.     if itemID == 0 then
    129.         print('Error in sending parcel. Custom currency was not set properly double check the spelling.')
    130.         return
    131.     end
    132.     local container = Game.createItem(2595, 1)
    133.     container:setAttribute(ITEM_ATTRIBUTE_NAME, 'Bounty Hunters Mail')
    134.     local label = container:addItem(2599, 1)
    135.     label:setAttribute(ITEM_ATTRIBUTE_TEXT, self:getName())
    136.     label:setAttribute(ITEM_ATTRIBUTE_WRITER, "Bounty Hunters Mail")
    137.     local parcel = addItemsToBag(1988, itemID, amount)
    138.     container:addItemEx(parcel)
    139.     container:moveTo(config.mailbox_position)
    140. end
    141.  
    142. function Player:getPremiumPoints(points)
    143.     local points = db.storeQuery("SELECT `premium_points` FROM `accounts` WHERE `id` = " .. self:getAccountId() .. ";")
    144.     if points then
    145.         local pointTotal = result.getDataInt(points, "premium_points")
    146.         result.free(points)
    147.     return pointTotal
    148.     end
    149.     return 0
    150. end
    151.  
    152. function Player:addPremiumPoints(points)
    153.     return db.query("UPDATE accounts SET premium_points = premium_points + "..points.." where id = "..self:getAccountId()..";")
    154. end
    155.  
    156. function Player:removePremiumPoints(points)
    157.     return db.query("UPDATE accounts SET premium_points = premium_points - "..points.." where id = "..self:getAccountId()..";")
    158. end
    159.  
    160. function Player:getBountyInfo()
    161.     local result_plr = db.storeQuery("SELECT prize, id, currencyType FROM `bounty_hunter_system` WHERE `target_id` = "..self:getGuid().." AND `killed` = 0;")
    162.     if (result_plr == false) then
    163.         return {false, 0, 0, 0, 0}
    164.     end
    165.     local prize = tonumber(result.getDataInt(result_plr, "prize"))
    166.     local id = tonumber(result.getDataInt(result_plr, "id"))
    167.     local bounty_type = tostring(result.getDataString(result_plr, "currencyType"))
    168.     result.free(result_plr)
    169.     return {true, prize, id, bounty_type, currency}
    170. end
    171.  
    172. local function addBountyKill(killer, target, prize, id, bounty_type, currency)
    173.     if not config.currencies[bounty_type] then
    174.         print('error in adding bounty prize')
    175.         return true
    176.     end
    177.     config.currencies[bounty_type].func(killer, prize, currency)
    178.     db.query("UPDATE `bounty_hunter_system` SET `killed` = 1, `killer_id`="..killer:getGuid()..", `dateKilled` = " .. os.time() .. " WHERE `id`  = "..id..";")
    179.     killer:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE,'[BOUNTY HUNTER SYSTEM] You killed ' .. target:getName() .. ' and earned a reward of ' .. prize .. ' ' .. bounty_type .. 's!')
    180.     if config.broadcastKills then
    181.         Game.broadcastMessage("Bounty Hunter Update:\n " .. killer:getName() .. " has killed " .. target:getName() .. " and earned a reward of " .. prize .. " " .. bounty_type .. "!", MESSAGE_EVENT_ADVANCE)
    182.     end
    183.     return true
    184. end
    185.  
    186. local function addBountyHunt(player, target, amount, currencyType)
    187.     db.query("INSERT INTO `bounty_hunter_system` VALUES (NULL," .. player:getGuid() .. "," .. target:getGuid() .. ",0," .. amount .. ", '" .. currencyType .. "', " .. os.time() .. ", 0, 0);")
    188.     player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "[BOUNTY HUNTER SYSTEM] You have placed bounty on " .. target:getName() .. " for a reward of " .. amount .. " " .. currencyType .. "!")
    189.     if config.broadcastHunt then
    190.         Game.broadcastMessage("[BOUNTY_HUNTER_SYSTEM]\n " .. player:getName() .. " has put a bounty on " .. target:getName() .. " for " .. amount .. " " .. t[2] .. ".", MESSAGE_EVENT_ADVANCE)
    191.     end
    192. return false
    193. end
    194.  
    195. function onBountyHunterSay(player, words, param)
    196.     if player:getLevel() < config.minLevelToAddBounty then
    197.         player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, '[BOUNTY_HUNTER_SYSTEM] You need level ' .. config.minLevelToAddBounty .. ' to use this command.')
    198.         return false
    199.     end
    200.     local t = param:split(",")
    201.     local name = t[1]
    202.     local currencyType = t[2] and trimString(t[2]) or nil
    203.     local amount = t[3] and tonumber(t[3]) or nil
    204.  
    205.     if not (name and currencyType and amount) then
    206.         local item = ItemType(customCurrency)
    207.         local text = '[BOUNTY HUNTER SYSTEM GUIDE]\n\nCommand Usage:\n!hunt playerName, type(gold/' .. customCurrency .. '/points), amount' .. '\n\n' .. 'Hunting for Gold:\n' .. '--> !hunt Joe,gold,150000\n' .. '--> Placed a bounty on Joe for the amount of 150,000 gps.' .. '\n\n' .. 'Hunting for Premium Points:\n' .. '--> !hunt Joe,points,100\n' .. '--> Placed a bounty on Joe for the amount of 100 premium points.'
    208.         text = text .. (item:getId() > 0 and ('\n\n' .. 'Hunting for ' .. item:getPluralName() .. ':\n' .. '--> !hunt Joe,' .. customCurrency .. ',50\n' .. '--> Placed a bounty on Joe for the amount of 50 ' .. item:getPluralName()) or '')
    209.         player:popupFYI(text)
    210.         return false
    211.     end
    212.  
    213.     local target = Player(name)
    214.     if not target then
    215.         player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, '[BOUNTY_HUNTER_SYSTEM] A player with the name of ' .. name .. ' is not online.')
    216.     return false
    217.     end
    218.  
    219.     if target:getGuid() == player:getGuid() then
    220.         player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, '[BOUNTY_HUNTER_SYSTEM] You may not place a bounty on yourself!')
    221.     return false
    222.     end
    223.  
    224.     if config.ipCheck and target:getIp() == player:getIp() then
    225.         player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, '[BOUNTY_HUNTER_SYSTEM] You may not place a bounty on a player from the same IP Address!')
    226.     return false
    227.     end
    228.  
    229.     if target:getLevel() < config.minLevelToBeTargeted then
    230.         player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, '[BOUNTY_HUNTER_SYSTEM] You may only target players level ' .. config.minLevelToBeTargeted .. ' and above!')
    231.     return false
    232.     end
    233.  
    234.     local info = target:getBountyInfo()
    235.     if info[1] then
    236.         player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "[BOUNTY HUNTER SYSTEM] This player has already been hunted.")
    237.         return false
    238.     end
    239.  
    240.     local typ = config.currencies[currencyType]
    241.     if not typ then
    242.         player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, '[BOUNTY_HUNTER_SYSTEM] The currency type "' .. currencyType .. '" is not a valid bounty currency. [Currencies: gold/points' .. (customCurrency ~= '' and '/'..customCurrency..'' or '') .. ']')
    243.     return false
    244.     end
    245.  
    246.     local minA, maxA = typ.minAmount, typ.maxAmount
    247.     if amount < minA or amount > maxA then
    248.         player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, '[BOUNTY_HUNTER_SYSTEM] The currency type of "' .. currencyType .. '" allows the amount to be in the range of ' .. minA .. ' --> ' .. maxA .. '.')
    249.     return false
    250.     end    
    251.  
    252.     if not typ.check(player, amount, currencyType) then
    253.         player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, '[BOUNTY_HUNTER_SYSTEM] You do not have ' .. amount .. ' ' .. currencyType .. '. [Error: Insufficient Funds]')
    254.     return false
    255.     end    
    256.      
    257.     return addBountyHunt(player, target, amount, currencyType)
    258. end
    259.  
    260.  
    261.  
    262. function onBountyHunterKill(creature, target)
    263.     if not target:isPlayer() then
    264.         return true
    265.     end
    266.  
    267.     if creature:getTile():hasFlag(TILESTATE_PVPZONE) then
    268.         return true
    269.     end
    270.  
    271.     local info = target:getBountyInfo()
    272.     if not info[1] then
    273.         return true
    274.     end
    275.  
    276.     return addBountyKill(creature, target, info[2], info[3], info[4], info[5])
    277. end
    278.  
    data/talkactions/talkactions.xml
    Code (Text):
    1. <talkaction words="!hunt" separator=" " script="bounty_hunter.lua" />
    data/talkactions/scripts/bounty_hunter.lua
    Code (Text):
    1. function onSay(player, words, param)
    2.     return onBountyHunterSay(player, words, param)
    3. end
    4.  
    data/creaturescripts/creaturescripts.xml
    Code (Text):
    1. <event type="kill" name="BountyHunterKill" script="bounty_hunter.lua"/>
    data/creaturescripts/scripts/bounty_hunter.lua
    Code (Text):
    1. function onKill(player, target)
    2.     return onBountyHunterKill(player, target)
    3. end
    data/creaturescripts/scripts/others/login.lua
    Code (Text):
    1. player:registerEvent('BountyHunterKill')
    Web Page:
    Code (Text):
    1. <?php
    2. ////////////// CONFIG START /////////////////////////
    3. $customCurrency = ''; // If you are using a custom currency add the name here
    4. $imgPath = 'http://outfit-images.ots.me/animatedOutfits1090/animoutfit.php'; // Path to your images (default is Gesior 10.90 animated outfit images)
    5. ////////////// CONFIG END /////////////////////////
    6.  
    7. $main_content .= '
    8.     <TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%>
    9.         <TR>
    10.             <TD style="text-align:center;"><H2>Bounty Hunters</H2></TD>
    11.         </TR>
    12.         <TR BGCOLOR="'.$config['site']['vdarkborder'].'">
    13.             <TD><CENTER><FONT COLOR=WHITE SIZE=2><b>How to use...</b></FONT></CENTER></TD>
    14.         </TR>';
    15.         if ($customCurrency != '') {
    16.         $main_content .= '
    17.         <TR BGCOLOR="'.$config['site']['darkborder'].'">
    18.             <TD style="text-align:center;"><b>!hunt playerName, points/gold/'.$customCurrency.', amount</b></TD>
    19.         </TR>';
    20.         } else {
    21.         $main_content .= '
    22.         <TR BGCOLOR="'.$config['site']['darkborder'].'">
    23.             <TD style="text-align:center;"><b>!hunt playerName, points/gold, amount</b></TD>
    24.         </TR>';
    25.         }
    26. $main_content .= '
    27.     </TABLE><br><br><table>
    28. ';
    29.  
    30. $main_content .= '
    31.         <TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%>
    32.             <TR BGCOLOR="#505050">
    33.                 <TD CLASS=white width=28%>
    34.                     <center><B>Hunted by</B></center>
    35.                 </TD>
    36.                 <TD CLASS=white width=14%>
    37.                     <center><B>Reward</B></center>
    38.                 </TD>
    39.                 <TD CLASS=white width=28%>
    40.                     <center><B>Player hunted</B></center>
    41.                 </TD>
    42.         <TD CLASS=white><b>Outfit</b></TD>
    43.                 <TD CLASS=white width=28%>
    44.                     <center><B>Killed by</B></center>
    45.                 </TD>
    46.             </TR>';
    47. foreach($SQL->query('SELECT A.* , B.name AS hunted_by, C.name AS player_hunted, D.name AS killed_by
    48.                         FROM bounty_hunter_system AS A
    49.                         LEFT JOIN players AS B ON A.hunter_id = B.id
    50.                         LEFT JOIN players AS C ON A.target_id = C.id
    51.                         LEFT JOIN players AS D ON A.killer_id = D.id
    52.                         ORDER BY A.killed,A.prize DESC') as $bounty) {
    53.         if($num%2 == 0){$color=$config['site']['darkborder'];}else{$color=$config['site']['lightborder'];}
    54.         if ($bounty['killed_by']){
    55.                 $killed_by = '<a href="?subtopic=characters&name='.$bounty['killed_by'].'">'.$bounty['killed_by'].'</a>';
    56.         } else {
    57.                 $killed_by = 'still alive';
    58.         }
    59.     $skill = $SQL->query('SELECT * FROM '.$SQL->tableName('players').' WHERE '.$SQL->fieldName('id').' = '.$bounty['target_id'].'')->fetch();
    60.         $main_content .= '
    61.                 <TR BGCOLOR="'.$color.'">
    62.                     <TD><center><b><a href="?subtopic=characters&name='.$bounty['hunted_by'].'">'.$bounty['hunted_by'].'</a></b></center></TD>
    63.                     <TD><center><b>'.$bounty[prize].' '.$bounty[currencyType].'</b></center></TD>
    64.                     <TD><center><b><a href="?subtopic=characters&name='.$bounty['player_hunted'].'">'.$bounty['player_hunted'].'</a></b></center></TD>
    65.            <TD><div style="position: relative; width: 32px; height: 32px;"><div style="background-image: url(\''.$imgPath.'?id='.$skill['looktype'].'&addons='.$skill['lookaddons'].'&head='.$skill['lookhead'].'&body='.$skill['lookbody'].'&legs='.$skill['looklegs'].'&feet='.$skill['lookfeet'].'\'); position: absolute; width: 64px; height: 80px; background-position: bottom right; background-repeat: no-repeat; right: 0px; bottom: 0px;"></div></div></TD>
    66.                     <TD><center><b>'.$killed_by.'</b></center></TD>
    67.                 </TR>';
    68.         $num++;
    69. }
    70. if($num == 0){
    71.         $main_content.='<TR BGCOLOR="'.$color.'"><TD colspan=4><center>Currently there are not any bounty hunter offer.</center></TD></TR>';
    72. }
    73.     $main_content .='</TABLE></table>';
    74. ?>

    List of things to do:
    1. Add in global broadcast that was requested somewhere in this thread
    2. Add in Bounty NPC
    3. Add in talkaction to check for active bounties
    4. Make webpage look prettier
    5. Allow players to add multiple bounties to 1 person
    6. Open for ideas
    Change Log
    • Fixed not removing Bank Balance
    • Fixed not checking Premium Points balance before removing. (Was putting into negative values)
    • No longer able to place bounty on self
    • Added option in config to check for ips (add ipCheck = true/false to your config or re-copy library)
     
    Last edited: Jan 4, 2017
  2. kamilwxx

    kamilwxx This account is inactive.

    Joined:
    Dec 7, 2013
    Messages:
    86
    Likes Received:
    18
    Best Answers:
    0
    Try this one:
    Code (Text):
    1. function onSay(cid, words, param)
    2.     if(param == "") then
    3.         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[BOUNTY HUNTERS] Use: \"!hunt [prize],[nick]\" where prize is for example 1(k).")
    4.         return TRUE
    5.     end
    6.     local t = string.split(param, ",")
    7.     if(not t[2]) then
    8.         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[BOUNTY HUNTERS] Use: \"!hunt [prize],[nick]\" where prize is for example 1(k).")
    9.         return TRUE
    10.     end
    11.  
    12.     local sp_id = getPlayerGUIDByName(t[2])
    13.     if sp_id == nil then
    14.         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[BOUNTY HUNTERS] This player doesn't exists.")    
    15.         return TRUE
    16.     end
    17.  
    18.     local result_plr = db.storeQuery("SELECT * FROM `bounty_hunters` WHERE `sp_id` = "..sp_id.."  AND `killed` = 0;")
    19.     if(result_plr ~= false) then
    20.         is = tonumber(result.getDataInt(result_plr, "sp_id"))
    21.         result.free(result_plr)
    22.     else
    23.         is = 0
    24.     end
    25.     prize = tonumber(t[1])
    26.  
    27.     if(prize == nil or prize < 1) then
    28.         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[BOUNTY HUNTERS] Use: \"!hunt [prize],[nick]\" where prize is for example 1(k).")
    29.         return TRUE
    30.     end
    31.  
    32.     if(prize >= 100000000000000000000) then
    33.         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[BOUNTY HUNTERS] Sorry, you typed too big number!")
    34.         return TRUE
    35.     end
    36.  
    37.     if is ~= 0 then
    38.         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[BOUNTY HUNTERS] This player has already hunted.")
    39.         return TRUE
    40.     end
    41.  
    42.     if doPlayerRemoveMoney(cid, prize*1000) == TRUE then
    43.         db.query("INSERT INTO `bounty_hunters` VALUES (NULL,"..getPlayerGUID(cid)..","..sp_id..",0," .. os.time() .. ","..prize..",0,0);")
    44.         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[BOUNTY HUNTERS] Hunt has been added!")        
    45.     else
    46.         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[BOUNTY HUNTERS] You haven't got enough money!")        
    47.     end
    48.  
    49.  
    50.     return 1
    51. end
     
    imkingran likes this.
  3. imkingran

    imkingran Learning everyday. Premium User

    Joined:
    Jan 15, 2014
    Messages:
    1,193
    Likes Received:
    360
    Best Answers:
    5
    Thanks man it worked!
     
  4. ricotje1

    ricotje1 Member

    Joined:
    Nov 8, 2012
    Messages:
    234
    Likes Received:
    2
    Best Answers:
    0
    how did you do that?
     
  5. Evil Puncker

    Evil Puncker I'd rather kiss a rattlesnake

    Joined:
    May 30, 2009
    Messages:
    5,366
    Likes Received:
    1,593
    Best Answers:
    1
    change db.getResult into db.storeQuery
     
  6. ricotje1

    ricotje1 Member

    Joined:
    Nov 8, 2012
    Messages:
    234
    Likes Received:
    2
    Best Answers:
    0
    But what for the other sciprts? Like the creaturescript and login.lua?
    like this: registerCreatureEvent(cid, "BountyHunter")
    or this: player:registerEvent("BountyHunter") ?
     
    Last edited: Apr 23, 2014
  7. ricotje1

    ricotje1 Member

    Joined:
    Nov 8, 2012
    Messages:
    234
    Likes Received:
    2
    Best Answers:
    0
    can you help me with the scripts? I tried so much but cant figure it out
     
  8. Maldero

    Maldero /root/

    Joined:
    Oct 2, 2010
    Messages:
    62
    Likes Received:
    1
    Best Answers:
    0
    Yeah can you help us?
     
  9. imkingran

    imkingran Learning everyday. Premium User

    Joined:
    Jan 15, 2014
    Messages:
    1,193
    Likes Received:
    360
    Best Answers:
    5
    @Maldero @ricotje1

    I updated the first post with the full system. I hope it is helpful to you, if you have any troubles let me know.
     
    ricotje1 and Maldero like this.
  10. Maldero

    Maldero /root/

    Joined:
    Oct 2, 2010
    Messages:
    62
    Likes Received:
    1
    Best Answers:
    0
    Love YOU! :D <3 THANKS!
     
  11. Maldero

    Maldero /root/

    Joined:
    Oct 2, 2010
    Messages:
    62
    Likes Received:
    1
    Best Answers:
    0
    And maybe you got tfs 1.0 war talkactions? eg. like on tfs 0.4 /war-invite etc..?
    Or lottery php?
     
  12. imkingran

    imkingran Learning everyday. Premium User

    Joined:
    Jan 15, 2014
    Messages:
    1,193
    Likes Received:
    360
    Best Answers:
    5
    Maldero likes this.
  13. Mauroel Brizola

    Mauroel Brizola New Member

    Joined:
    Apr 17, 2014
    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    How to add Bountyhunters.php to ZNote AAC?
     
  14. Jp06

    Jp06 New Member

    Joined:
    Oct 26, 2008
    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    it is not working...
     
  15. mori2005

    mori2005 Member

    Joined:
    Feb 19, 2009
    Messages:
    68
    Likes Received:
    0
    Best Answers:
    0
    znote plzzz
     
  16. Cotizado

    Cotizado Member

    Joined:
    May 12, 2008
    Messages:
    321
    Likes Received:
    5
    Best Answers:
    0
    adding outfit on the players might be great
     
  17. imkingran

    imkingran Learning everyday. Premium User

    Joined:
    Jan 15, 2014
    Messages:
    1,193
    Likes Received:
    360
    Best Answers:
    5
    I edited the Talkaction to fix a few minor bugs that allowed players to enter a bounty even with an invalid name and the minimum bounty must be 1kk. You can edit the minimum prize as you like on this line:

    Code (Text):
    1.     if(prize == nil or prize < 1000000) then
    2.         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[BOUNTY HUNTERS] The prize can not be less than 1kk.")
    3.         return TRUE
    4.     end
    I also edited the Creaturescript so that the money is now sent directly to the players bank instead of there backpack.

    Also both the addition of a bounty and the kill will now be broadcasted.

    It might be frustrating if you can't wear the outfit of your choice because other players keep adding a bounty to you. :(
     
    Last edited: Jul 27, 2014
  18. Cotizado

    Cotizado Member

    Joined:
    May 12, 2008
    Messages:
    321
    Likes Received:
    5
    Best Answers:
    0
    i mean in the php not online lol
    and other thing letting the target know that he is bounty
     
  19. imkingran

    imkingran Learning everyday. Premium User

    Joined:
    Jan 15, 2014
    Messages:
    1,193
    Likes Received:
    360
    Best Answers:
    5
    Oh lol :D

    I'll see what I can do and update you back ;)
     
    Cotizado likes this.
  20. imkingran

    imkingran Learning everyday. Premium User

    Joined:
    Jan 15, 2014
    Messages:
    1,193
    Likes Received:
    360
    Best Answers:
    5

Share This Page

Loading...