• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved points for killing players

magista

RL name " Amir reda "
Joined
Jul 22, 2011
Messages
157
Solutions
1
Reaction score
21
Location
Egypt
i need lua when i kill a player i get 1 pk_points i tried too much but need some help plz :D
 
What 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.
 
just 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
 
What 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.
tfs 0.4
and i already have a columns in accounts called pk_points

just 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
i'm not understand bro :D
 
Last edited by a moderator:
well frags are per character, I think using storages is better cus of performance, I mean query needs to connect to the db
btw if you want querys
Code:
db.executeQuery('UPDATE accounts SET pk_points = pk_points + '1' WHERE id=' .. getPlayerAccountId(cid))
 
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
 
I don't understand why people using this line:
Code:
if player:getStorageValue(value) == -1 then 
player:setStorageValue(value, 0)
end
 
Gesior 0.3.8

thx alot men but i need help in this
add 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>';
 
add 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>';
Fatal error: Call to a member function getCustomField() on a non-object in C:\xampp\htdocs\characters.php on line 84
 
Code:
player:setStorageValue(1000, math.max(1, player:getStorageValue(1000)) + 1)
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.
 
Back
Top