onKill()
if player:getStorageValue(value) == -1 then player:setStorageValue(value, 0) end
if kill then player:setStorageValue(value, player:getStorageValue(value) +1) end
end
tfs 0.4What server version?
You can also just do a table on the database
Create pktable (id and count as parameters) and then you increase the count everytime you kill someone. I don't know the code, just thought this might help.
i'm not understand brojust use storages
Code:onKill() if player:getStorageValue(value) == -1 then player:setStorageValue(value, 0) end if kill then player:setStorageValue(value, player:getStorageValue(value) +1) end end
db.executeQuery('UPDATE accounts SET pk_points = pk_points + '1' WHERE id=' .. getPlayerAccountId(cid))
if player:getStorageValue(value) == -1 then
player:setStorageValue(value, 0)
end
teach usI don't understand why people using this line:
Code:if player:getStorageValue(value) == -1 then player:setStorageValue(value, 0) end
i have another question in character.php
how can i add pk points >>> amount of points appear to all @StreamSide
i mean by that like
name >>> player name
level >>> player level
pk points >> amount of pk points
got it, thanks btwCode:player:setStorageValue(1000, math.max(1, player:getStorageValue(1000)) + 1)
No problem mategot it, thanks btw
add this in characters.php
$bgcolor = (($number_of_rows++ % 2 == 1) ? $config['site']['darkborder'] : $config['site']['lightborder']);
$pk_points = $account_logged->getCustomField('pk_points');
$main_content .= '<tr bgcolor="' . $bgcolor . '"><td>PK Points:</td><td>' . $pk_points . ' points</td></tr>';
Fatal error: Call to a member function getCustomField() on a non-object in C:\xampp\htdocs\characters.php on line 84add this in characters.php
PHP:$bgcolor = (($number_of_rows++ % 2 == 1) ? $config['site']['darkborder'] : $config['site']['lightborder']); $pk_points = $account_logged->getCustomField('pk_points'); $main_content .= '<tr bgcolor="' . $bgcolor . '"><td>PK Points:</td><td>' . $pk_points . ' points</td></tr>';
Which is the same thing in terms of performance, just easier to read. Right? I remember someone tested at there was almost no difference (tested with big numbers). Or maybe Im mixing things up.Code:player:setStorageValue(1000, math.max(1, player:getStorageValue(1000)) + 1)